vim /etc/httpd/conf/httpd.confvim
新增以下三行rest
RewriteEngine onit
RewriteCond %{HTTPS} !=onservice
RewriteRule ^(.*) https://%{SERVER_NAME}$1 [L,R]im
重啓Apache便可vi
systemctl restart httpd.serviceco