加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 编程开发 > asp.Net > 正文

asp.net – IIS Web.Config 301重定向查询字符串参数(?)

发布时间:2020-12-16 07:23:49 所属栏目:asp.Net 来源:网络整理
导读: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

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读