【问题标题】:ERR_TOO_MANY_REDIRECTS IIS rules www HTTPS and old urlsERR_TOO_MANY_REDIRECTS IIS 规则 www HTTPS 和旧网址
【发布时间】:2020-05-07 09:24:41
【问题描述】:

我在 IIS www、https 和旧 url 重定向中有 3 个规则。但它似乎陷入了一个循环,我得到了一个错误,有没有办法将这三个结合起来以防止这种情况发生?

<rule name="SSL" stopProcessing="true">
    <match url="(.*)" />
    <conditions>
    <add input="{HTTPS}" pattern="off" />
    </conditions>
    <action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}"   redirectType="Permanent" />
</rule>
<rule name="www" stopProcessing="true">
  <match url=".*"/>
  <conditions>
    <add input="{HTTP_HOST}" pattern="^test.com$"/>
  </conditions>
  <action type="Redirect" url="https://www.test.com/{R:0}" redirectType="Permanent"/>
</rule>
<rule name="OLD URL redirects">
    <match url=".*"/>
    <conditions>
        <add input="{OldRedirects:{REQUEST_URI}}" pattern="(.+)"/>
    </conditions>
    <action type="Redirect" url="{C:1}" appendQueryString="false"/>
</rule>

认为将它们结合起来可以解决问题吗?但我无法让它工作

【问题讨论】:

  • 能否请您发布有关您对 url 重写规则的要求的详细信息。除了。我需要知道您使用的哪个域面临多重重定向错误。

标签: redirect iis mod-rewrite url-rewriting url-rewrite-module


【解决方案1】:

事实证明规则是正确的,错误在 RewriteMaps 中

【讨论】:

    猜你喜欢
    • 2020-11-28
    • 1970-01-01
    • 2015-08-12
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-04-19
    • 2011-09-18
    • 1970-01-01
    相关资源
    最近更新 更多