【问题标题】:chrome redirects to secure assetschrome 重定向到安全资产
【发布时间】:2015-07-23 08:22:49
【问题描述】:

我在使用 chrome 时遇到了一种奇怪的行为。我有 WP 网站http://flytime.hu,它没有 SSL,从来没有。如果我尝试登录站点(/wp-login.php),它会尝试使用 https 协议加载大量资产(css、脚本),但是页面本身是使用 http 加载的。

如果我检查页面源,我可以看到以 https 开头的 url。这不会发生在 Firefox(或其他浏览器)中。我无法登录,因为登录也重定向到 https 协议(https://flytime.hu/wp-login.php)。

经过这样的试用后,主站点的行为方式相同(资产未加载,因为 SSL 协议错误)。然后我必须完全重新安装 chrome 才能至少恢复主站点。清除 cookie、缓存等都没有帮助。

chrome 中的来源(网址:http://flytime.hu/):

<link rel='stylesheet' id='bkb-font-awesome-styles-css'  href='https://flytime.hu/wp-content/plugins/bwl-kb-manager/css/font-awesome.min.css?ver=1.0.7' type='text/css' media='all' />
<link rel='stylesheet' id='bkbm-custom-styles-css'  href='https://flytime.hu/wp-content/plugins/bwl-kb-manager/css/bkbm-custom-styles.css?ver=1.0.7' type='text/css' media='all' />
<link rel='stylesheet' id='contact-form-7-css'  href='https://flytime.hu/wp-content/plugins/contact-form-7/includes/css/styles.css?ver=4.2.1' type='text/css' media='all' />
<link rel='stylesheet' id='blogsynthesis_jss_css-css'  href='https://flytime.hu/wp-content/plugins/jquery-smooth-scroll/css/jss-style.min.css?ver=4.2.2' type='text/css' media='all' />

Firefox 中的来源(网址:http://flytime.hu/):

<link rel='stylesheet' id='bkb-font-awesome-styles-css'  href='http://flytime.hu/wp-content/plugins/bwl-kb-manager/css/font-awesome.min.css?ver=1.0.7' type='text/css' media='all' />
<link rel='stylesheet' id='bkbm-custom-styles-css'  href='http://flytime.hu/wp-content/plugins/bwl-kb-manager/css/bkbm-custom-styles.css?ver=1.0.7' type='text/css' media='all' />
<link rel='stylesheet' id='contact-form-7-css'  href='http://flytime.hu/wp-content/plugins/contact-form-7/includes/css/styles.css?ver=4.2.1' type='text/css' media='all' />
<link rel='stylesheet' id='blogsynthesis_jss_css-css'  href='http://flytime.hu/wp-content/plugins/jquery-smooth-scroll/css/jss-style.min.css?ver=4.2.2' type='text/css' media='all' />

【问题讨论】:

    标签: php wordpress google-chrome ssl


    【解决方案1】:

    现在在 function.php 文件上试试这个。

    function https_chromev44fix() {
        $_SERVER['HTTPS'] = false;
    }
    
    add_action( 'init', 'https_chromev44fix', 0 );
    

    【讨论】:

      【解决方案2】:

      我也有同样的问题。版本 44.0.2403.89 m 中的 Chrome 与 nginx 一起执行 https 重定向,而不是像我在 nginx 中配置的 http。

      【讨论】:

        【解决方案3】:

        将 Chrome 更新到 版本 45.0.2454.12 dev-m,事情就消失了。

        【讨论】:

          猜你喜欢
          • 2013-10-29
          • 2013-07-01
          • 2020-10-13
          • 2011-09-19
          • 1970-01-01
          • 1970-01-01
          • 2021-05-21
          • 2013-03-28
          • 1970-01-01
          相关资源
          最近更新 更多