正确配置将所有http子域重定向到https

时间:2017-12-02 18:31:55

标签: apache ssl redirect https wildcard-subdomain

我有一个apache的以下配置。

<VirtualHost *:80>
    ServerName example.com
    Redirect permanent / https://example.com/
</VirtualHost>
<VirtualHost *:443>
    ServerName example.com
    SSLEngine on
    SSLCertificateFile <path to ssl certificate file>
    SSLCertificateKeyFile <path to key file>
    SSLCACertificateFile <path to CA certificate file>
</VirtualHost>

我需要帮助才能将所有http子域重定向到https子域。提前谢谢。

e.g。

  1. http://example.comhttps://www.example.com
  2. https://example.comhttps://www.example.com
  3. http://subdomain.example.comhttps://subdomain.example.com

0 个答案:

没有答案