<rule name="blog" stopProcessing="true">
<match url="en/blog.aspx?Id=9" />
<action type="Redirect" url="http://www.mynewurl.com" redirectType="Permanent" />
</rule>
我可以重定向“en/blog.aspx”,但无法仅重定向“en/blog.aspx?Id=9”。
有任何想法吗?
<rule name="blog" stopProcessing="true">
<match url="en/blog.aspx?Id=9" />
<action type="Redirect" url="http://www.mynewurl.com" redirectType="Permanent" />
</rule>
我可以重定向“en/blog.aspx”,但无法仅重定向“en/blog.aspx?Id=9”。
有任何想法吗?
终于找到了解决办法:
/en/blog.aspx?Id=9 将重定向到http://www.newurl.com。
<rule name="blog" stopProcessing="true">
<match url="en/blog.aspx$" />
<conditions>
<add input="{QUERY_STRING}" pattern="Id=9" />
</conditions>
<action type="Redirect" url="http://www.newurl.com" redirectType="Permanent" />
</rule>
在这里找到解决方案:301 redirect not working in IIS 7