【问题标题】:IIS URL Rewrite 301 Redirect for urls with parameters doesn't work带有参数的 url 的 IIS URL 重写 301 重定向不起作用
【发布时间】:2012-04-11 19:52:17
【问题描述】:

我有以下 301 重定向规则:

<rule name="301RedirectsRule" enabled="true" stopProcessing="true">
  <match url=".*" />
    <conditions logicalGrouping="MatchAll">
       <add input="{301Redirects:{URL}}" pattern="(.+)" />
    </conditions>
    <action type="Redirect" url="{C:1}" redirectType="Permanent" />
</rule>

在rewrite map中有规则:

<add key="/di/web/home/Glossary/index.aspx" value="/resources/dental-terminology" />
<add key="/di/web/knowledge-base/article.aspx?id=62" value="/resources/oral-pathology/oral-conditions-and-diseases/periodontal-disease" />

第一个完美运行,但任何带参数的 URL(如第二个)都不起作用。

【问题讨论】:

    标签: iis parameters query-string url-rewrite-module


    【解决方案1】:

    我并不完全了解 IIS 重写模块,但您可以尝试将 {301Redirects:{URL}} 替换为 {301Redirects:{REQUEST_URI}}

    我相信第一个不包含查询字符串。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2015-01-29
      • 2011-10-28
      • 1970-01-01
      • 1970-01-01
      • 2014-01-06
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多