[英]IIS Web.Config 301 Redirect on Query String Parameter (?)
<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重定向在IIS 7中不起作用
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.