Forum Moderators: phranque
==================
RewriteEngine on
Options +FollowSymlinks
# Rule 1
RewriteRule ^(.*)(gr¦gmail¦gcal¦greader)$ products/gr [QSA,L]
# Rule 2
RewriteRule ^(.*)gr/update.rdf$ http://www.example.com/products/gr/extension/update.rdf [QSA,L]
# Rule 3
RewriteRule ^(.*)gr/?page=changelog$ http://www.example.com/products/gr/?page=changelogs [QSA,L]
==================
Rule 1 redirects correctly.
Rule 2 redirects correctly.
Rule 3 redirects to products/gr
Why would rule 3 not work?
Thank you.
[edited by: jdMorgan at 1:34 pm (utc) on Nov. 17, 2009]
[edit reason] example.com [/edit]
If it is supposed to be a rewrite it needs to be listed after the redirects. If it is instead meant to be a redirect, you need to add FQDN and R=301 to it.
If it is a rewrite, then it is very dangerous as it maps an infinite number of duplicate URLs to one internal filepath. Even without the (.*) it would still map a very large number.
QSA is the default action, so does not need to be stated on either of the first two rules. You only need QSA when you want to re-append the original query string data on the end of new query string data.
Your last two rules produce a 302 redirect. I suspect that you will want a 301 redirect.
Rule 3 can NEVER work. RewriteRule cannot see Query Strings. You need a preceding RewriteCond to test %{QUERY_STRING}.