Score:0

virtual host `Redirect permanent` redirecting all http > https from one single vhost

cn flag

The error I am having is:

All http domains are being forwarded to https://www.XYZ.com as a single example outlined below:

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.vhost

<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.vhost

<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.vhost

<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>
Liso avatar
sd flag
Well I think what happens is you only have one valid ssl certificate (it happens to me frequently), but this site is not suitable for this kind of questions, try asking at [su]
cn flag
I actually had just removed the ssl certificates. I have left the question open as in the end, resetting chrome was the answer to sorting out the redirects. Even after flushing my local DNS `(base) hutber@hutber:~$ sudo resolvectl flush-caches (base) hutber@hutber:~$ sudo systemd-resolve --flush-caches`
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.