In my Apache 2.4.41 HTTP server I have some HTTPS virtualhosts, and an HTTP-only one. I noticed that this HTTP virtualhost is not reachable, because users are always redirected to the default HTTPS virtualhost: when an user wants to visit http://water.sitename.com he gets redirected to https://app.sitename.com
I used apache2ctl -S
command and virtualhosts look correctly configured to me:
VirtualHost configuration:
*:80 is a NameVirtualHost
default server app.sitename.com (/etc/apache2/sites-enabled/app.sitename.com.conf:1)
port 80 namevhost app.sitename.com (/etc/apache2/sites-enabled/app.sitename.com.conf:1)
port 80 namevhost ticket.sitename.com (/etc/apache2/sites-enabled/ticket.sitename.com.conf:1)
port 80 namevhost water.sitename.com (/etc/apache2/sites-enabled/water.sitename.com.conf:1)
port 80 namevhost www.sitename.com (/etc/apache2/sites-enabled/www.sitename.com.conf:2)
*:443 is a NameVirtualHost
default server app.sitename.com (/etc/apache2/sites-enabled/app.sitename.com.conf:15)
port 443 namevhost app.sitename.com (/etc/apache2/sites-enabled/app.sitename.com.conf:15)
port 443 namevhost ticket.sitename.com (/etc/apache2/sites-enabled/ticket.sitename.com.conf:15)
port 443 namevhost www.sitename.com (/etc/apache2/sites-enabled/www.sitename.com.conf:63)
alias sitename.com:443
And here is water.sitename.conf
in sites-enabled folder:
<VirtualHost *:80>
ServerName water.sitename.com
ServerAdmin [email protected]
ErrorLog /var/log/apache2/water.sitename.com/error.log
CustomLog /var/log/apache2/water.sitename.com/access.log combined
DocumentRoot /var/www/drupal
<Directory "/var/www/drupal/">
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
</VirtualHost>
Do you have any clue?