lucy24 - 2:09 am on Jul 9, 2011 (gmt 0)
will this do both the non-www/www redirect, remove any and all parameters, and not create an infinite redirect loop? (the +++ are mine - do not want to create a false link)
Heheh, that's the whole point of example.com. The Forums are especially coded so http://www.example.com will never turn into a link:
Wasn't that fun?
You'll need a RewriteCond testing QUERY_STRING or THE_REQUEST to make sure the original request did have an appended query string. To be clear, if you accidentally redirect "without query string" to "without query string", you will end up with an infinite redirect loop.
That is: At every point, you need to make sure the rules only apply to patterns that have not already had this Rewrite done to them. (That is what makes [N] so dangerous. You have to make sure that eventually there will be nothing left to rewrite.)
In your case, there are two things:
means apply the following rule to any request that doesn't use either the exact name "www.example.com" or nothing at all.
means apply the following rule only to requests that currently have a query string. \S means a non-space of any kind, un-anchored. You might even get away with . meaning "anything whatsoever" but that looks a bit too minimalist. If your Mystery Code is appending spurious queries that consist entirely of spaces, I don't want to hear about it.