views:

40

answers:

2

hello.... my current url is

categories_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?

+3  A: 

Try it with the B flag for backreference escaping:

RewriteRule ^carriers/(.*)$ categories_name.php?cname=$1 [L,B]
Gumbo
occuring '500 Internal Server Error' when i put B flag
muralikalpana
@muralikalpana: And what does the server’s error log say?
Gumbo
A: 

& 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

Emil Vikström
i was encoded. still getting same problem
muralikalpana