Well, in my C# ASP .Net MVC application I have an URL:
controller/action?parameter=value
I need to redirect this URL in web.config
using rewrite rules to:
controller/action?parameter=anotherValue
I've already configured the necessary section like below:
<rule name="Redirect" patternSyntax="Wildcard" stopProcessing="true">
<match url="controller/action?parameter=value" />
<action type="Redirect" url="controller/action?parameter=anotherValue" />
</rule>
But this rule just doesn't work. Also I've tried:
<rule name="Redirect" patternSyntax="Wildcard" stopProcessing="true">
<match url="controller/action$" />
<conditions>
<add input="{QUERY_STRING}" pattern="parameter=value" />
</conditions>
<action type="Redirect" url="controller/action?parameter=anotherValue" redirectType="Permanent" />
but this rule redirects me to: controller/action?parameter=value¶meter=anotherValue
How can I correctly perform this redirection?