I'm running a legacy website which has a tonne of 301 redirects on it. In an effort to make my life simpler, I switched them from doing manual 301 redirects in IIS to using the url rewriting module and a rewrite map, which I can generate from the database.
Unfortunately I've now hit a snag, in that some of their urls come with querystrings (from Google's adwords), and these invariably 404 (because they don't match the urls in my rewrite map).
Is there a way around this, or do I have to go back to manually doing the 301s?
For the record: we're using IIS7
Code samples:
url: http://mydomain.com/widgets/?gclid=[google code]
Rewrite Rule:
<rule name="Rewrite rule1 for News301Redirects" stopProcessing="false">
<match url=".*" />
<conditions>
<add input="{News301Redirects:{REQUEST_URI}}" pattern="(.+)" />
</conditions>
<action type="Redirect" redirectType="Permanent" url="{C:1}" appendQueryString="false" />
</rule>
Map Line:
<add key="/widgets/" value="/widgets.asp" />