apache配置.htaccess使http转向https

如果需要整站跳转,则在网站的配置文件的.htaccess标签内,键入以下内容:

RewriteEngine on

RewriteCond %{SERVER_PORT} !^443$

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