开发者

& symbol problem in htaccess

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜