Web.config重写规则在Google Chrome中不起作用 [英] Web.config rewrite rule not working in Google Chrome

查看:115
本文介绍了Web.config重写规则在Google Chrome中不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我使用除chrome之外的任何浏览器访问mycompany.com时,它都会成功重定向到 https://www.mycompany.com.但是在Chrome浏览器中,我得到的却是404,与所有chrome用户一样.

When I visit mycompany.com in any browser except chrome, it successfully redirects to https://www.mycompany.com. However in Chrome I just get a 404, ditto all chrome users.

在web.config中,我有此重定向规则

In web.config I have this redirect rule

<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>

我认为这是使其在其他浏览器中起作用的原因.

Which I think is what makes it work in other browsers.

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

I've tried adding a HTTP redirect dns record, but that doesn't seem to have helped.

推荐答案

打开一个隐身标签,并验证该标签是否重定向到您想要的URL.

Open a incognito tab and verify that it is redirecting to the URL you want it to.

关闭隐身标签

清除Google Chrome浏览器缓存

Clear Google Chrome cache

然后它应该重定向您,而无需使用隐身模式

It should then redirect you without having to use incognito mode

这篇关于Web.config重写规则在Google Chrome中不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆