How to handle special characters in .htaccess rules?

proteam4
proteam4 used Ask the Experts™
on
In my .htaccess file I have defined following rule,

RewriteRule t/([^.]+)/$ /videos/tag.php?tag=$1 [QSA]
The above rule works fine if I am browsing http://example.com/videos/t/world+news/ or http://example.com/videos/t/events/

but when I am browsing http://example.com/videos/t/business+%26+world/ (here original tag is: business & world) then in my query string tag variable I am getting only business. '& world' is not coming when I am fetching variable data through $_GET['tag']

Can anyone please tell where is the problem in the above rule??
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Apparently, %26 is decoded to & in the process.
If you need only wory for the case described "foo & bar", you may try an extra rule
t/([^.])+%26([^.])+/$  videos/tag.php?tag=$1%26$2

Author

Commented:
n/a

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial