I need to create a rewrite rule as follows:
OldPage.aspx?UserId=12345 should redirect to NewPage.aspx?Id=12345
the '12345' can be any numeric value.)
I have the page redirect working, but not sure how to change the 'UserId' to 'Id' (I can do it in my code, but would rather do it in the web.config).
This is what I have:
<rewrite> <rules> <rule name="Old Site to New" patternSyntax="Wildcard" stopProcessing="true"> <match url="*OldPage.aspx*" /> <action type="Rewrite" url="NewPage.aspx" appendQueryString="true" logRewrittenUrl="true" /> </rule> </rules> </rewrite>
I am using wildcards, but a suggestion with either regex or wildcards would be OK by me.