So I created a sitemap and submitted it to google, problem is I messed up on one of the variables. Instead of it saying services= it said service= so the pages all got indexed but its all messed up. I am trying to 301 mod rewrite the messed up URLs to the correct ones. I have written it like so RewriteRule ^services.php?st=(.*)&city=(.*)&service=(.*)$ services.php?st=$1&city=$2&services=$3 [R=301,L] Code (markup): However it is not redirecting! Am I doing something wrong?
RewriteRule doesn't apply the match to the querystring. You need to use RewriteCond for that. RewriteCond %{QUERY_STRING} ^st=([^&]+)&city=([^&]+)&service=([^&])$ RewriteRule services\.php$ services.php?st=%1&city=%2&services=%3 [R=301] Code (markup): Note that when using RewriteCond back-references, you use %N instead of $N.