Forum Moderators: phranque
I am having trouble with my .htaccess rewrite rule, where I can't seem to properly escape the question mark in the url I want to redirect.
Here is my example:
RewriteRule ^report2\.html\?loc=wna_us_fl_cape_canaveral$
/surf-forecast/cape-canaveral-florida.html [R=301,L]
The problem area is the .html\?loc=... If I take away the questions mark then it works fine and the escape character doesn't seem to work in this example.
Any help here? Much appreciated.
this is what i did:
RewriteCond %{QUERY_STRING} ^loc=wna_us_fl_cape_canaveral$
RewriteRule ^report2\.html$ /surf-forecast/cape-canaveral-florida.html [R=301,L]
This does the redirect, however, the query string gets appended on to the new url. How do I get rid of the query string. Perhaps this is what you were referring to with the testing / back referencing? I'm not sure how to go about that.
well at least I know for next time (very soon actualy), thanks for the info