I am having an issue with my virtual host setup for days. My server is a vserver with debain linux and I am trying to add two new domains which will be redirected to their own subfolders.
Domain1.com --> /var/www/domain1
Domain2.com --> /var/www/domain2
The setup is working fine, but the domains are not redirecting to the subfolders but the server root directory. So if I open "domain1.com" I get redirected to "domain1.com/mail" which is the roundcube installation.
Here is how I did the setup:
/etc/apache2/sites-available/domain1
<VirtualHost domain1.com> ServerAdmin webmaster@localhost ServerAlias domain1.com *.domain1.com DocumentRoot /var/www/domain1 </VirtualHost> /etc/hosts
127.0.0.1 localhost.localdomain localhost domain1.com www.domain1.com I just don't get it why it's not redirected to the subfolder... Can someone please tell me what I am doing wrong?
DocumentRoottells Apache what to serve. If you want it to go to another folder, use a redirect.