1.首先配置Aapache 支持https访问,Apache开启mod_rewrite模块
2.打开httpd-vhosts.conf文件
<VirtualHost *:80>
RewriteEngine On
RewriteRule ^(.*)$ https://%{HTTP_HOST}$1 [R,L]
ServerAdmin webmaster@localhost
DocumentRoot /home/server/www
ServerName a.test.local
ErrorDocument 404 /error.php
</VirtualHost>