【问题标题】:IIS Web.Config 301 Redirect on Query String Parameter (?)IIS Web.Config 301 重定向查询字符串参数 (?)
【发布时间】:2012-06-14 18:27:16
【问题描述】:
    <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,还是说您无法在操作中重定向到它?
  • 匹配不适用于查询参数

标签: asp.net iis web-config


【解决方案1】:

终于找到解决办法了:

/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

【讨论】:

猜你喜欢
  • 1970-01-01
  • 2011-01-30
  • 1970-01-01
  • 2021-03-09
  • 2017-04-13
  • 1970-01-01
  • 2018-01-29
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多