Zblog .htaccess HTTP全站301重定向到HTTPS
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后台程序,伪静态组件,会默认生成.htaccess文件,我们只需要在文件中增加如下内容即可:
RewriteCond %{SERVER_PORT} !^443$
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R=301]
注意这段内容,一定要放在头部!一定要放在头部!
本文链接:http://www.58q.org/b/12.html 转载需授权!