应用SSL证书后,为什么安全锁会从我的wordpress网站上消失?

时间:2018-05-08 13:26:12

标签: wordpress ssl ssl-certificate

我已在wordpress网站上申请了SSL证书。当我加载网站安全锁显示几秒钟,然后消失。我该如何调试问题?

1 个答案:

答案 0 :(得分:0)

确保您的图片和/或请求是通过https而不是http发送的。

所以,而不是: http://www.yoursite.com/wp-content/uploads/year/month/logo.png 用这个: https://www.yoursite.com/wp-content/uploads/year/month/logo.png

另外,请检查.htaccess文件是否具有重定向到https的规则,以及代码,以备不时之需。

RewriteEngine On
RewriteCond %{HTTPS} off
# First rewrite to HTTPS:
# Don't put www. here. If it is already there it will be included, if not
# the subsequent rule will catch it.
RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
# Now, rewrite any request to the wrong domain to use www.
# [NC] is a case-insensitive match
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule .* https://www.%{HTTP_HOST}%{REQUEST_URI} [L,R=301]