>   

如何让http强制跳转到HTTPS

如何让http强制跳转到HTTPS;方法就是这样;

建立一个.htaccess文件在根目录

<IfModule mod_rewrite.c>

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-d

RewriteCond %{REQUEST_FILENAME} !-f

RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]

</IfModule>

上面是伪静态的Rewrite规则

# BEGIN rlrssslReallySimpleSSL rsssl_version[2.5.26]

<IfModule mod_rewrite.c>

RewriteEngine on

RewriteCond %{HTTPS} !=on [NC]

RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

</IfModule>

# END rlrssslReallySimpleSSL

这里是SSL加密以后强制转换成https

要发表评论,您必须先登录