http强转https

需要在httpd.conf文件最后添加即可:

<Directory />

    Options FollowSymLinks

    AllowOverride All

RewriteEngine on

RewriteCond %{SERVER_PORT} !^443$

RewriteRule ^(.*)?$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]

</Directory>

之后重启apache即可。