Forum Moderators: phranque
The URL is of the following form:
[domain.com...]
I want to put up a redirect, so I put the following in my .htaccess:
Redirect permanent /product.php/22/1/%7D [domain.com...]
Unfortunately, it isn't working...any ideas why?
I suspect that mod_alias is testing that %7D as a literal, not as an escaped character.
I'd recommend trying RedirectMatch (see mod_alias) or mod_rewrite, both of which allow you to use regular expressions and to test escaped characters.
RedirectMatch 301 ^/product\.php/22/1/\%7D$ http://www.domain.com/product.php/22/1/
I have a solution. I tried it just on the off chance, without much hope of success but hey ho, it worked?!
The code I used is:
RewriteRule ^/product\.php(.+)}$ [localhost:8080...] [R=permanent]
I just used the character '}' on the rule, not the encoded version (%7D). So, mod rewrite must decode the url before it is run through the rules.
Interesting...