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 has '&' symbol then problem occuring. so how to write htaccess url?

Now I could be wrong with the actual cause of your problem here, but what I do know is that the ampersand has special meaning in most contexts (including .htaccess, PHP and in page URLs). Its literal use should be avoided because when you use it in a URL, the web server is going to treat it as a new part of the query string data (GET data).

For example:

categories_name.php?cname=at&t

What this URL is aying to PHP is:

categories_name.php is the file to open, and to use this as GET data:

cname is at
t is null

You could encode the ampersand using something like urlencode() in PHP, but I personally recommend trimming out any literal ampersands or replacing them with something like "and".

This isn't just something effecting PHP or .htaccess either - it is how all web requests are treated. The ? and & characters have special meaning in URL syntax so their occurrence should either be escaped or avoided in a literal sense.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.