Never mind, fixed it..
But now I've found another issue..
I'm prepping a site migration at the moment from one old webapp, to a brand new one, unfortunately virtually all of the querystrings are different, and a lot of the values no longer apply..
Ideally I want to run various lookups on the querystring and redirect to the new page(s), one good method I though would be to use the funky new rewrite maps, but it appears that it only works with static URLs?
If I use the following rule:
<rule name="Redirect to new pages" stopProcessing="true">
<match url="articles.aspx\?(ArticleID=[0-9]+).*" />
<conditions>
<add input="{ArticleRedirects:{R:1}}" pattern="(.+)" />
</conditions>
<action type="Redirect" url="newarticles.aspx?RCODE={C:1}" appendQueryString="true" />
</rule>
<rewriteMap name="ArticleRedirects">
<add key="ArticleID=2" value="898" />
</rewriteMap>
..to look up the ArticleID equivilent on the new site, then use that value in the redirect action.. but it doesn't work..
The other way is to use a more standard lookup and pass in the querystring to perform the lookup, but it will only look up the exact querystring, so if there are any other querystrings added on for tracking etc, the redirect will fail..
<rule name="Redirect to New Pages 2" stopProcessing="true">
<match url="articles.aspx.*" />
<conditions>
<add input="{ArticleRedirects:{QUERY_STRING}}" pattern="(.+)" />
</conditions>
<action type="Redirect" url="newArticles.aspx?RCODE={C:1}" appendQueryString="true" />
</rule>
There must be an easy way around this, other than having a map entry for every single eventuality, or an equally large number of standard redirect rules?