Apache 2.4太多重定向,www到非www和http到https

时间:2018-05-27 01:56:52

标签: apache virtualhost

的httpd.conf:

Include conf.d/ports.conf
IncludeOptional sites-enabled/*.conf

conf.d / ports.conf

Listen 80
Listen 443

/ example.com.conf启用位点-

<VirtualHost *:80>
    ServerName example.com
    ServerAlias www.example.com
    Redirect permanent / https://example.com/ 
</VirtualHost>

<VirtualHost *:443>
    ServerName example.com
    ServerAlias www.example.com
    DocumentRoot /var/www/example.com/public_html

    SSLEngine on
    SSLCertificateFile /etc/httpd/ssl/example.com.certificate.pem
    SSLCertificateKeyFile /etc/httpd/ssl/example.com.key.key

    <Directory /var/www/example.com/public_html/>
        Options +FollowSymlinks
        AllowOverride All
        Require all granted
    </Directory>

    ErrorLog /var/log/httpd/example.com.error.log
    CustomLog /var/log/httpd/example.com.access.log combined

    ProxyPassMatch ^/(.*\.php(/.*)?)$ fcgi://127.0.0.1:9000/var/www/example.com/public_html/$1
    DirectoryIndex index.php index.html
</VirtualHost>

...但它只是给了我“任意组合的太多重定向”(www,非www,http或https)。

0 个答案:

没有答案