url

CodeIgniter with encrypted URLs

对着背影说爱祢 提交于 2021-02-05 06:42:26
问题 I want to use codeigniter framework for my project but I dont want it readable, so i have to encrypt url like: http://myproject.com/index.php/indexcontroller/myaction/ into: http://myproject.com/as79d8a7sd9a8sd7a98d7a9s8d790akmwmwm97aw I dont know how to achieve such scenario. How controller and methods will be called and how it will be performed. Please guide me. 回答1: This sounds like a job for URI routing! Add this to your config/routes.php : $route['(:any)'] = "MyController/MyFunc/$1"; Now

CodeIgniter with encrypted URLs

微笑、不失礼 提交于 2021-02-05 06:42:08
问题 I want to use codeigniter framework for my project but I dont want it readable, so i have to encrypt url like: http://myproject.com/index.php/indexcontroller/myaction/ into: http://myproject.com/as79d8a7sd9a8sd7a98d7a9s8d790akmwmwm97aw I dont know how to achieve such scenario. How controller and methods will be called and how it will be performed. Please guide me. 回答1: This sounds like a job for URI routing! Add this to your config/routes.php : $route['(:any)'] = "MyController/MyFunc/$1"; Now

Regex for URL with query string

萝らか妹 提交于 2021-02-04 18:51:27
问题 I'm trying to create a regular expression to use as a rule in fiddler. I'm not very good at regular expressions. This regular expression: http://myServer:28020/MyService/ItemWebService.json?([a-zA-Z]+) Matches the URL below: http://myServer:28020/MyService/ItemWebService.json?action=keywordSearch&username=StockOnHandPortlet&sessionId=2H7Rr9kCWPgIZfrxQiDHKp0&keywords=blue&itemStatus=A So far so good. But why when I try this regular expression: http://myServer:28020/MyService/ItemWebService

Regex for URL with query string

社会主义新天地 提交于 2021-02-04 18:50:45
问题 I'm trying to create a regular expression to use as a rule in fiddler. I'm not very good at regular expressions. This regular expression: http://myServer:28020/MyService/ItemWebService.json?([a-zA-Z]+) Matches the URL below: http://myServer:28020/MyService/ItemWebService.json?action=keywordSearch&username=StockOnHandPortlet&sessionId=2H7Rr9kCWPgIZfrxQiDHKp0&keywords=blue&itemStatus=A So far so good. But why when I try this regular expression: http://myServer:28020/MyService/ItemWebService

Regex for URL with query string

喜欢而已 提交于 2021-02-04 18:50:06
问题 I'm trying to create a regular expression to use as a rule in fiddler. I'm not very good at regular expressions. This regular expression: http://myServer:28020/MyService/ItemWebService.json?([a-zA-Z]+) Matches the URL below: http://myServer:28020/MyService/ItemWebService.json?action=keywordSearch&username=StockOnHandPortlet&sessionId=2H7Rr9kCWPgIZfrxQiDHKp0&keywords=blue&itemStatus=A So far so good. But why when I try this regular expression: http://myServer:28020/MyService/ItemWebService

Javascript regexObj.exec() says TypeError: pattern.exec is not a function

梦想与她 提交于 2021-02-04 18:15:57
问题 I want to extract image name from img tag with regex in javascript . My problem is that console.log() throws Exception: TypeError: pattern.exec is not a function . JS: $("label.btn-danger").on('click',function(e){ e.preventDefault(); var src = $(this).parents("label").find("img").attr("src"); var pattern = "/\/([A-Z0-9_-]{1,}\.(?:png|jpg|gif|jpeg))/ig"; var result = pattern.exec(src) console.log(result); }); 回答1: var pattern = "/\/([A-Z0-9_-]{1,}\.(?:png|jpg|gif|jpeg))/ig"; Creates a string.

url design: ways to hide pk/id from url

江枫思渺然 提交于 2021-02-04 17:38:30
问题 To access the details page of an Item on my site, one would use the following url <mydomain>/item/1 where 1 is the primary key of the Item I am looking for a solution that allows me to redesign the url with the following requirements: exclude pk or any sequential ids from the url be able to uniquely access the Item details page I intended to ask this as a general web design question, but just thought I should mention that I am working with Python/Django. 回答1: You need to have some kind of

Use character # in URL inside file name

陌路散爱 提交于 2021-02-04 17:28:09
问题 I need to put a link with this href="file://attachments/aaaa_#_aaaa.msg" Obviously in that way is not working because the hash character # is used for anchors. So I try to change this to: href="file://attachments/aaaa_%23_aaaa.msg" but when I open the url in the IE, the browser is trying to open this: href="file://attachments/aaaa_%2523_aaaa.msg" IE is encoding the % character to %25 How can I put the file name in the URL to encode and read the hash character # in all the browsers to download

Use character # in URL inside file name

爱⌒轻易说出口 提交于 2021-02-04 17:28:05
问题 I need to put a link with this href="file://attachments/aaaa_#_aaaa.msg" Obviously in that way is not working because the hash character # is used for anchors. So I try to change this to: href="file://attachments/aaaa_%23_aaaa.msg" but when I open the url in the IE, the browser is trying to open this: href="file://attachments/aaaa_%2523_aaaa.msg" IE is encoding the % character to %25 How can I put the file name in the URL to encode and read the hash character # in all the browsers to download

get file name for url php

情到浓时终转凉″ 提交于 2021-02-04 16:09:18
问题 I wanted to know how to get the current file name in PHP to be able to load the same file in a different directory. index.php works.php lang/de/ index.php works.php lang/pl/ index.php works.php <div id="language"> <a href="../../index.php" class="lang">EN</a> <a class="lang" href="index.php">DE</a> <a class="lang" href="../pl/index.php">PL</a> </div> The current method is redirecting the lang URL, allways to index.php. I would love to know how to redirect from works.php to lang/de/works.php