我有一个虚拟主机,它通过 SSL 将非 www 重定向到 www:
<VirtualHost *:443>
ServerName example.com
Redirect / https://www.example.com/
# Do I need to include SSL configuration here?
</VirtualHost >
# Main Site
<VirtualHost *:443>
ServerName www.example.com
Redirect / https://www.example.com/
# Rest of the configurations including SSL
</VirtualHost >
我是否需要在第一个仅执行重定向的 vhost 块中包含 SSL 配置和证书?如果我省略第一个 vhost 块中的 SSL 配置,重定向和站点仍能正常工作,那么为什么我需要将 SSL 证书放在第一个 vhost 块中?