1
Answer

Url rewrite with ASP.NET query string

Sourabh Dhiman

Sourabh Dhiman

5y
2.8k
1
<rule name="Redirect" stopProcessing="true">
<match url="(.*)" />
<conditions trackAllCaptures="true">
<add input="{QUERY_STRING}" pattern="&amp;?(beta=[^&amp;]+)&amp;?" />
<add input="{QUERY_STRING}" pattern="&amp;?(gamma=[^&amp;]+)&amp;?" />
<add input="{REQUEST_URI}" pattern="^/redirect" negate="true" />
</conditions>
<action type="Redirect" url="/redirect?{C:1}&amp;{C:2}" appendQueryString="false" redirectType="Found" />
</rule>
 
Please check this code .
 
I will try this code local host .
 
my url -http://localhost:56966/reservations/reservation.aspx -- 
Answers (1)