Replace %26 in htaccess to %2526
Posted
by
Patrick
on Server Fault
See other posts from Server Fault
or by Patrick
Published on 2011-01-03T16:08:24Z
Indexed on
2011/01/03
16:55 UTC
Read the original article
Hit count: 221
Hi all,
I would like htaccess to rewrite example.com/something_%26_else into example.com/something_%2526_else.
I'm importing a bunch of pages that have ampersands in the title from Mediawiki. These are encoded as %26. Drupal, for various reasons, has decided double encode the url it to have it become %2526. I simply can't create the alisis within Drupal so I have to use htaccess
This is what I have as my rule so far as RewriteRule ^w/([^%26]+)\%26(.*)$ w/$1\%2526$2 [R=301]
I asked this question three months ago on stackexchange and was not able to get it working. I tried hiring a contractor for this but was unable to find one. So this my last ditch effort before I completely give up. I really appreciate the help.
All the best, Patrick
© Server Fault or respective owner