Trying to redirect: /common/offers/landing.php?offer=randomacts to /promotions/random-acts/index.html but i believe the ? is giving me problems. Any thoughts?
g1smd
8:38 pm on Nov 5, 2010 (gmt 0)
Use a preceding RewriteCond looking at QUERY_STRING to examine all parts after the question mark.
Use a RewriteRule for the redirect itself.
When you redirect, do not include the "index.html" part in the target URL, end the target with a trailing slash.
The redirect target needs to include the protocol and domain as well the [R=301,L] flags.
ads112001
8:57 pm on Nov 5, 2010 (gmt 0)
so i'm trying this: RewriteEngine On RewriteCond %{QUERY_STRING} ^(offer=randomacts$) RewriteRule ^(.*) /promotions/random-acts/ [R=301,L]
but it's taking me to /promotions/random-acts/?offer=randomacts instead of /promotions/random-acts/
g1smd
10:50 pm on Nov 5, 2010 (gmt 0)
Add a question mark to the end of the target URL. This will clear the query string value.
Add the protocol and domain name to the target URL.
Be aware that if there are any other parameters included with the request, that your code will not redirect the request.