代码之家  ›  专栏  ›  技术社区  ›  user2728841

网状物配置重写规则在Google Chrome中不起作用

  •  1
  • user2728841  · 技术社区  · 8 年前

    当我参观我的公司时。com在除chrome以外的任何浏览器中,它成功重定向到 https://www.mycompany.com 。然而,在Chrome中,我只得到了404,所有Chrome用户也是如此。

    在web中。配置我有这个重定向规则

    <rewrite>
      <rules configSource="">
        <clear />
        <rule name="Redirect to https" stopProcessing="true">
          <match url=".*" />
          <conditions>
            <add input="{HTTPS}" pattern="off" ignoreCase="true" />
          </conditions>
          <action type="Redirect" url="https://{HTTP_HOST}{REQUEST_URI}" redirectType="Permanent" appendQueryString="true" />
        </rule>
      </rules>
    </rewrite>
    

    我认为这就是它在其他浏览器中工作的原因。

    我尝试添加HTTP重定向dns记录,但似乎没有帮助。

    2 回复  |  直到 8 年前
        1
  •  2
  •   Michael Henderson    8 年前

    打开一个incognito选项卡,验证它是否重定向到您想要的URL。

    关闭“匿名”选项卡

    清除Google Chrome缓存

    然后它应该重定向您,而不必使用匿名模式

        2
  •  1
  •   H.Mikhaeljan    8 年前

    我真的没有什么解释。我自己也在用这个。

    <rewrite>
          <rules>
            <rule name="HTTP to HTTPS redirect" stopProcessing="true">
              <match url="(.*)" />
              <conditions>
                <add input="{HTTPS}" pattern="off" ignoreCase="true" />
              </conditions>
              <action type="Redirect" redirectType="Found" url="https://{HTTP_HOST}/{R:1}" />
            </rule>
          </rules>
        </rewrite>
    

    它们看起来非常相似,但我没有看到重定向到https的问题。也许是别的什么东西烧焦了404?