Forum Moderators: phranque
I'm attaching a parameter to my URL for ad campaigns, and strip off the parameter when it arrives.
RewriteCond %{QUERY_STRING} ^ppc=code [NC]
RewriteCond %{HTTP_HOST} ^(.*)$[NC]
RewriteRule ^(.*)$ http://%1/$1? [R=302,L]
The 302 Found says, in part, the client SHOULD continue to use the Request-URI for future requests. But if the Request-URI contains my string I'd rather not have it used again. Something tells me a 301 might be better here... and I might improve my tracking by reducing duplicate URI's with the attached string.
Not sure why you've got that second RewriteCond in there. I'd recommend:
RewriteCond %{QUERY_STRING} ^ppc=code [NC]
RewriteRule ^(.*)$ http://%{HTTP_HOST}/$1? [R=301,L]
Jim
Thanks for the confirmation.