網站本來是http的,為了響應谷歌的政策,現在換成https的,虽然https可以訪問了,但瀏覽器還是沒變成綠色的。
使用F12查看后发现原因是其中有些圖片的連接還是http的链接,目前的解決方法就是安裝WordPress HTTPS插件
另外http的如果需要強制跳轉到https的,可以在.htaccess改成下面的內容,其中的{SERVER_NAME}改成實際的域名,比如www.icka.org
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 |
# BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{SERVER_PORT} 80 RewriteRule ^(.*)$ https://{SERVER_NAME}/$1 [R,L] RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfModule> # END WordPress |
在wp-config.php加上
1 |
define('FORCE_SSL_ADMIN', true); |
這樣登錄管理員使用SSL的方式