그래서 지금 내 구성은 다음과 같습니다.
Listen 443 http
Listen 80
NameVirtualHost *:80
NameVirtualHost *:443
ServerName *:80
<VirtualHost *:443>
[some non-ssl stuff(directory, docroot)]
ServerName account.example.com
SSLEngine on
SSLCertificateFile /Users/myusername/certs/server.crt
SSLCertificateKeyFile /Users/myusername/certs/server.key
</VirtualHost>
<VirtualHost *:80>
SSLEngine off
[other stuff like docroot]
</VirtualHost>
확실하지 않습니다 SSLEngine off
, 그러나 지금은 작동합니다. 따라서 http vhost의 .htaccess 파일에서 http에서 https로 리어 리어 리어 리어 리그 리더를 추가합니다.
#Redirrect from http to https
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R,L]