将网址重定向到新网址忽略web.config中的参数
问题描述:
我想将我的旧网址(../Galary.aspx?cat=10)改为新网址(../ jacket-style-gallery)但它附加了旧的参数。将网址重定向到新网址忽略web.config中的参数
<rule name="rule9" stopProcessing="true">
<match url="(.*)" />
<conditions>
<add input="{QUERY_STRING}" pattern="cat=10" />
</conditions>
<action type="Redirect" url="./jacket-style-gallery" appendQueryString="false"/>
</rule>
所以,如果你想只Galary.aspx
被重定向,那么你应该使用它重定向到” ../jacket-style-gallery?cat=10"
答
:
<rule name="rule9" stopProcessing="true">
<match url="Galary.aspx" />
<conditions>
<add input="{QUERY_STRING}" pattern="cat=10" />
</conditions>
<action type="Redirect" url="./jacket-style-gallery" appendQueryString="false"/>
</rule>
我刚刚在我的服务器上测试过,它工作正常。