RewriteEngine on
RewriteCond %{SERVER_PORT} !^443 [NC]
RewriteRule ^(.*)$ https://%{SERVER_NAME}$1 [L,R=301]

 

Centos+Apache站点配置SSL强制跳转443
https://fanly.net/article/6MzAu8MzFh
转载请注明出处,谢谢!