我想强制使用 https。所有已签名且准备就绪的证书均有效。在 httpd.conf 中,我输入了:
redirect permanent / https://my.site.org
Firefox 和 Chrome 似乎使用 https,但 Safari 却不使用。如果我点击带有 https 的链接,它就可以正常工作。但对于 index.html,它却不想这样做。
知道原因吗?!
httpd.conf:
<VirtualHost *:80>
ServerAdmin [email protected]
DocumentRoot /var/www/html
ServerName admin.mysite.info
redirect permanent / https://admin.mysite.info
#ServerAlias admin.mysite.info
#ErrorLog logs/dummy-host.example.com-error_log
#CustomLog logs/dummy-host.example.com-access_log common
</VirtualHost>
ssl.conf
<VirtualHost _default_:443>
DocumentRoot "/var/www/html"
ServerName admin.mysite.info:443
SSLEngine on
SSLCertificateFile /etc/httpd/ssl/certificate.crt
SSLCertificateKeyFile /etc/httpd/ssl/apache.key
SSLCertificateChainFile /etc/httpd/ssl/certificateCA.crt