虚拟主机“永久重定向”从单个虚拟主机重定向所有 http > https

虚拟主机“永久重定向”从单个虚拟主机重定向所有 http > https

我遇到的错误是:

所有 http 域名都将被转发至https://www.XYZ.com如下文概述的一个例子:

Current:
http://warhammer.ABC.com > https://www.XYZ.com //incorrect
http://www.EDF.com       > https://www.XYZ.com //incorrect
http://www.XYZ.com       > https://www.XYZ.com //correct

Expected:
http://warhammer.ABC.com > https://warhammer.ABC.com
http://www.EDF.com       > http://www.DEF.com
http://www.XYZ.com       > https://www.XYZ.com

abc.虚拟主机

<VirtualHost *:80>
    ServerName warhammer.ABC.com
    Redirect permanent / https://warhammer.ABC.com/
</VirtualHost>
<IfModule mod_ssl.c>
    <VirtualHost *:443>
    ServerName warhammer.ABC.com
    
    DirectoryIndex index.php index.html

    DocumentRoot /var/www/warhammer.ABC.com
    <Directory /var/www/warhammer.ABC.com>
        Options FollowSymLinks
        AllowOverride All

        Order allow,deny
        Allow from all
    </Directory>

    ....
    
    </VirtualHost>
</IfModule>

xyz.虚拟主机

<VirtualHost *:80>
    ServerName api.xyz.com
    Redirect permanent / https://api.xyz.com
</VirtualHost>
<IfModule mod_ssl.c>
    <VirtualHost *:443>
        ServerName api.xyz.com

        ProxyRequests on

        ProxyPass / http://127.0.0.1:4006/
        ProxyPassReverse / http://127.0.0.1:4006/
        
        ....

    </VirtualHost>
</IfModule>

edf.虚拟主机

<VirtualHost *:80>
    DocumentRoot /var/www/edf.com
    ServerName www.edf.com
    ServerAlias edf.com

    php_value include_path "/usr/share/php:/var/www/edf.com"
    php_value error_reporting 2047
    php_flag magic_quotes_gpc off
    php_flag short_open_tag off

    DirectoryIndex index.php index.html

    <Directory /var/www/edf.com>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all
    </Directory>
    
</VirtualHost>

相关内容