Reputation: 11
I have a url that needs to be rewritten.
http://aplus-carpetcleaning.com/home.php%3Fcity%3DGainesville%2520VA
I have tried this:
^home\.php%3Fcity%3DGainesville%2520VA$ "http://aplus-carpetcleaning.com/home.php?city=Gainevilles%20VA"
This is not being recognized. Tried various alternates but no dice.
Notes:
%3F
is '?' %3D
is '=', %2520
is who knows?Upvotes: 1
Views: 1665
Reputation: 11
Fixed it with:
RewriteRule ^home\.php(.*)city(.*)Gainesville(.*)VA$ "http:\/\/aplus\-carpetcleaning\.com\/home\.php?city=Gainesville VA" [R=301,L]
Upvotes: 0
Reputation: 42925
The rewriting module applies your regex patterns to decoded urls, not the urlencoded string you see inside the browsers url field.
So create your regex pattern using unescaped characters instead. Something like:
^home.php\?city=Gainesville&20VA$
Upvotes: 1