#httpアクセスが来たらhttpsに転送する。 <VirtualHost *:80> ServerName democa.local ServerAlias localhost DocumentRoot /var/www/html RewriteEngine On RewriteCond %{SERVER_PORT} 80 RewriteCond %{SERVER_NAME} !localhost RewriteRule ^(.*)?$ https://%{HTTP_HOST}$1 [R,L] </VirtualHost> <VirtualHost _default_:443> SSLEngine On SSLCertificateFile /opt/demoCA/cert.pem SSLCertificateKeyFile /opt/demoCA/nokey.pem SSLCACert