自动跳转到https,使用地址重写功能

RewriteEngine on 
RewriteBase / 
RewriteCond %{SERVER_PORT} !^443$ 
RewriteRule ^.*$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
Clicky