0

I need to redirect multiple urls from this format:

http://site.com/gallery.php%3Fpage%3D12

(the 12 at the end is the page number, i have many links like this with different numbers at the end)

to this:

http://site.com/gallery.php?page=12

how to i write a rule in htaccess that will replace those chars in all the urls and redirect them to the correct urls?

2 Answers 2

0

By default URLs in mod_rewrte are decoded(unescaped) so there is no need to escape(encode) them!

0

As mentioned by "Death", there is no need to replace the chars, this simple rule did the trick:

RewriteRule ^gallery\.php\?page\=(.*) http://site.com/gallery.php?page=$1 [R=301,L]

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.