I am configuring a webmail on my Apache/2.4.25 server, and I’m having problems with redirecting to one of the subdomains. I’m currently unsing (probably in the most inelegant way) one .conf file for every vhost.
The content of this .conf is:
<VirtualHost *:80> ServerName webmail.vignati.eu DocumentRoot /var/www/vhosts/webmail.vignati.eu DirectoryIndex index.htm index.html index.php ServerAlias vignati.eu ErrorDocument 404 /404.html ErrorDocument 500 /50x.html ErrorDocument 502 /50x.html ErrorDocument 503 /50x.html ErrorDocument 504 /50x.html ErrorLog /var/log/apache2/webmail.vignati-eu_error_log CustomLog /var/log/apache2/webmail.vignati.eu_access_log combined <Directory /(README.md|INSTALL|LICENSE|CHANGELOG|UPGRADING)$ > Order Deny,Allow Deny from all </Directory> <Directory /(bin|SQL|config|temp|logs)/> Order Deny,Allow Deny from all </Directory> </VirtualHost> <VirtualHost *:80> ServerName mail.vignati.eu DocumentRoot /var/www/vhosts/mail.vignati.eu/public-html DirectoryIndex index.htm index.html index.php ServerAlias vignati.eu ErrorDocument 404 /story.php ErrorLog /var/log/apache2/mail.vignati-eu_error_log CustomLog /var/log/apache2/mail.vignati.eu_access_log combined Redirect permanent / https://mail.vignati.eu/ </VirtualHost> [...]
The file goes on with the configuration of www. and the https configurations for www. and mail. (which all work fine)
My problem is that when I try to navigate to webmail.vignati.eu, I get redirected to the index.html file that is in
DocumentRoot /var/www/vhosts/mail.vignati.eu/public-html
But the correct DocumentRoot, as specified in the vhost is
DocumentRoot /var/www/vhosts/webmail.vignati.eu
Could anyone help me find what I’m getting wrong?
(The server is switched-off at the moment, so if anyone wanted to check by themselves, sorry, but it’s not possible)