overlapping g1, so we may say the same things. Or, worse, may say opposite things :( If what I have tried doesn't work then does what I tried even really matter.
Well, what
really matters is: Does "doesn't work" mean "has no effect at all whatsoever, no matter what file I request" or does it mean "It does
something only not what it was supposed to do"
It's definitely easier to test a redirect than a rewrite, because you can see it working. Even if it works wrong, your browser's address bar will tell you what it thought it was doing.
Oh yes and... If the query string does contain "zoneid" do you want to keep the whole thing, or only the "zoneid" piece and still dump everything else?
The query-string-testing part is easy:
RewriteCond %{QUERY_STRING} .
RewriteCond %{QUERY_STRING} !zoneid
This, by itself, will also filter out requests for non-pages, since those will never come with a query string. At least you hope they won't. But it isn't the best way to do it; it's much better to put that part in the body of the rule. Don't look at me though: I don't know what your page URLs look like, and how many of them need to be covered by the rule.
is there a way to set up the RewriteRule so that I can just add any future query strings like zoneid that I don't want redirecting
Even mod_rewrite has its limits. One thing it can't do is see into the future and foretell what parameters you might use at some later date. So the most you can do is keep adding exceptions:
RewriteCond %{QUERY_STRING} !(zoneid|otherterm)
and you can only do it this way if there is no overlap among your parameter names. Otherwise it's
!(^|&)zoneid=[^&]*($|&)
!(^|&)otherterm=[^&]*($|&)
on separate lines: not A and also not B.
Which may actually be less work for the server, but I'm not in a position to find out. [edited by: lucy24 at 8:07 am (utc) on Mar 31, 2013]