Zblog .htaccess HTTP全站301重定向到HTTPS
RewriteEngine On
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R=301]
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
zblog后臺(tái)程序,偽靜態(tài)組件,會(huì)默認(rèn)生成.htaccess文件,我們只需要在文件中增加如下內(nèi)容即可:
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R=301]
注意這段內(nèi)容,一定要放在頭部!一定要放在頭部!