Asp.net 将Url重定向到新Url,忽略web.config中的参数
我想将我的旧url(../Galary.aspx?cat=10)重定向到新url(../jacket style gallery),但它附加了旧参数Asp.net 将Url重定向到新Url,忽略web.config中的参数,asp.net,redirect,iis,web-config,Asp.net,Redirect,Iis,Web Config,我想将我的旧url(../Galary.aspx?cat=10)重定向到新url(../jacket style gallery),但它附加了旧参数 <rule name="rule9" stopProcessing="true"> <match url="(.*)" /> <conditions> <add input="{QUERY_STRING}" pattern="cat=10" /> </conditi
<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
要重定向,则应使用:
<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>
我刚刚在我的服务器上进行了测试,它可以正常工作