【问题标题】:wordpress site from http to https, category pages keep load js and css resources files from http instead https while other pages are all goodwordpress 网站从 http 到 https,分类页面保持从 http 加载 js 和 css 资源文件而不是 https 而其他页面都很好
【发布时间】:2017-02-16 00:41:08
【问题描述】:

我遇到了一个关于 wordpress 的奇怪问题。 我已将 wordpress 网站从 http 移至 https,类别页面保持从 http 而不是 https 加载 js 和 css 资源文件,而其他页面都很好。 functions.php 中没有添加类别模板,也没有 is_category() 处理程序。有人知道是什么问题吗?

【问题讨论】:

  • 控制台中是否有任何警告或错误?
  • 是的,有。 Mixed Content: The page at 'https://staging-1.ponoko.com/blog/category/promotional-products/' was loaded over HTTPS, but requested an insecure script 'http://staging-1.ponoko.com/blog/wp-content/plugins/audio-player/assets/audio-player.js?ver=20100105100911'. This request has been blocked; the content must be served over HTTPS. staging-1.ponoko.com/:202 Uncaught ReferenceError: AudioPlayer is not defined (index):203
  • 一个简单的 HSTS (Header always set Strict-Transport-Security "max-age=31536000") + HTTP2HTTPS 重定向 (RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L] ) 会在您找到问题出处时修补问题(Apache htaccess 示例)。

标签: php css wordpress themes


【解决方案1】:

在 WordPress->Settings->General 下,您会发现 WordPress 地址 (URL) 和站点地址 (URL) 将它们更新为以 https:// 开头。

如果执行上述操作未能解决问题,请查看模板的页眉和页脚,以检查您是否使用 http:// 拉入外部或内部文件,如果您要删除 http: 并离开 / /

如果这有助于解决问题,请告诉我,如果没有,我还有其他想法。

【讨论】:

【解决方案2】:

找到所在的地方

http://staging-1.ponoko.com/blog/wp-content/plugins/audio-p‌​layer/assets/audio-p‌​layer.js?ver=2010010‌​5100911

包括在内并将其更改为https请求:

https://staging-1.ponoko.com/blog/wp-content/plugins/audio-p‌​layer/assets/audio-p‌​layer.js?ver=2010010‌​5100911

【讨论】:

    猜你喜欢
    • 2012-09-26
    • 2016-10-17
    • 2015-02-09
    • 1970-01-01
    • 1970-01-01
    • 2014-09-16
    • 2013-12-29
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多