我有域hubket.com,我通過godaddy啓用了https。現在它已正確啓用https,如果你打開它。如何在WordPress中使用.htaccess啓用HTTPS?
現在,我想轉換成WWW或者WWW沒有爲所有用戶像這樣http://www.hubket.com
我試圖將啓用在這樣的教程一些測試代碼!
測試1
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase/
RewriteCond %{ENV:HTTPS} !=on
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [R,L]
# BEGIN WordPress
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
測試2
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
請幫我開HTTPS爲所有用戶。
感謝
我已編輯您的建議代碼。但我害怕做你建議我的DB腳本。因爲可能會影響DB。任何其他或安全的解決方案? –
當然,它會影響你的數據庫。在使用此腳本之前執行備份,然後用您的建議腳本更新您的博客URL並使用它的https版本 –
更新替換。現在用https強行登錄,但普通網站並不強制用https打開,仍然用非https開啓 –