当我调试Visual Studio项目使用Chrome浏览器尝试重定向到https相当于我的web地址。我没有在web项目中启用SSL,并且开始URL是http URL。当我使用FireFox或IE进行调试时,我没有这个问题。

我重新安装了Chrome浏览器,解决了这个问题一天。没有下载任何插件的问题再次发生了第二天。

什么是使Chrome重定向localhost到https?

网络巡检显示: 请求URL:数据:text / html, chromewebdata 请求头 显示临时标题 User-Agent:Mozilla/5.0 (Windows NT 6.3;WOW64) AppleWebKit/537.36 (KHTML,像Gecko) Chrome/36.0.1985.143 Safari/537.36

这些选项卡中没有预览和响应数据。


当前回答

另一种选择是使用类似https://github.com/rchampourlier/tunnelss的东西

当然,它增加了另一个依赖/设置,但它也允许在开发中测试https,这可能很好。

我使用RVM,然而,让隧道工作,我必须使用sudo宝石安装隧道和sudo隧道

其他回答

借阿迪亚特·穆巴拉克的东风

不能硬刷新,因为它只是在https上刷新。遵循一些相同的步骤。

1. Open chrome developer tools (ctrl + shift + i)
2. Network Tab at the top
3. Click Disable cache checkbox at the top (right under network tab for me).
4. Refresh page (while the developer tools is still open)

chrome://net-internals/#hsts 

在“删除域安全策略”下输入域,按“删除”键。

我找不到任何解决办法;而是重定向到我的网络。配置允许我继续工作(localhost),直到我找到导致问题的原因。

这本质上是一个将HTTPS转换为HTTP的重写规则;它似乎已经覆盖了之前将HTTP重定向到HTTPS的规则。

它需要在你的系统中。网络服务器> < /系统。web.config中的webServer>部分

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

@Adiyat Mubarak的回答对我没用。当我试图清除缓存并重新加载时,页面仍然重定向到https。

我的解决方案是:在url栏的右上角(就在收藏夹星形图标的左边)有一个带有“x”的图标。右键单击它,它会显示一些关于“不安全脚本”的内容,然后有一个选项可以加载它们。这样做。

如果你碰巧在Wordpress网站上工作,在尝试了这个页面上的所有内容后,http://127.0.0.1/wp-admin仍然被重定向到https://127.0.0.1/wp-admin。试试这个:

进入wp-config.php并替换

定义(' WP_HOME ', ' https://example.com ');

define('WP_SITEURL','https://example.com');

to

定义(' WP_HOME ', ' http://127.0.0.1 ');

define('WP_SITEURL','http://127.0.0.1');

在Chrome和Firefox上测试。