您好,歡迎來(lái)到58網(wǎng)站目錄!
當(dāng)前位置:58網(wǎng)站目錄 » 站長(zhǎng)資訊 » 小技巧 » 文章詳細(xì)

Zblog .htaccess HTTP全站301重定向到HTTPS

站長(zhǎng)「蝙蝠俠」:QQ1251270088  瀏覽:7076次 時(shí)間:2022-03-23

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)容,一定要放在頭部!一定要放在頭部!




本文地址:http://quema.com.cn/artinfo/2715.html
?