I am running IIS 7 with the official rewriting rules module installed. I would like to create a rewrite rule to match this URL:
http://www.sample.com/en-us/test.aspx?q=keyword
After overwriting the expected result will be:
http://www.sample.com/en-us/test.aspx?q=keyword&flag=value
How to create a rule for its implementation?
I checked the following rule, but with no luck, it always got a redirect loop error:
<rewrite> <rules> <rule name="test" stopProcessing="true"> <match url="(.*)/test\.aspx(.(?!flag=value))*$" /> <action type="Redirect" url="{R:0}&flag=value" appendQueryString="false" logRewrittenUrl="true" /> </rule> </rules> </rewrite>
source share