I have recently started adding a query string to my adwords campaigns for tracking and I was hoping for this to show up in my logs (at least on the first pass) but then be removed prior to displaying the actual page.
I thought of using mod-rewrite but I guessed that that's only for rewriting the host/filename stuff.... but then I found:
When you want to erase an existing query string, end the substitution string with just the question mark.
Two questions: 1) is this possible (and where's my mistake - the 302's meant to be inoccuous and the L is there so it loops); and 2) perhaps more importantly - by stripping off the string will I ever see it in the logs (I was hoping that it would show up in the first pass and then disappear for the display and then the remainder of the logs).
I do not (yet) have my own weblog software so I was simply going to use Grep for windows to get an idea of adwords traffic.
I guess therefore - the fourth of my two questions (!) is - any better ideas for a simple analysis of adwords (but then I guess that's another forum). I'm still curious about my mod-rewrite problem though :)
The code you posted should work. But I seem to recall running into problems when trying to use server variables in the substitution in .htaccess. Try this slight modification to see if that's the problem: