开发者

& symbol problem in htaccess

开发者 https://www.devze.com 2023-01-01 03:59 出处:网络
my current url is categorie开发者_如何学Gos_name.php?cname=at&t rewritten url like this. carriers/at&t

my current url is

categorie开发者_如何学Gos_name.php?cname=at&t

rewritten url like this.

carriers/at&t

this is htaccess url.

RewriteRule ^carriers/(.*)$ categories_name.php?cname=$1 [L]

above url is working for all like

categories_name.php?cname=all-tel

when variable(at&t) has '&' symbol then problem occuring. so how to write htaccess url?


Try it with the B flag for backreference escaping:

RewriteRule ^carriers/(.*)$ categories_name.php?cname=$1 [L,B]


& is a separator between different arguments in the querystring. at&t must therefore be urlencoded like this: at%26t otherwise PHP will see it as if you had two arguments: cname and t

0

精彩评论

暂无评论...
验证码 换一张
取 消