: Vhost sends www.* to another domain I created a virtual host at my server to host multiple sites, but I got a few unexpected problems. One sites doesn't gets recognized by the server and is
I created a virtual host at my server to host multiple sites, but I got a few unexpected problems. One sites doesn't gets recognized by the server and is redirected to another domain on the server, another one just works without 'www' but the one with the 'www' gets also redirected to a different domain.
The code i use in vhost.conf is:
<VirtualHost *:80>
ServerName domain.com
#ServerAlias domain.com domain.com
DocumentRoot /var/www/vhosts/domain.com
#ServerAdmin mail@domain.com
<Directory /var/www/vhosts/domain.com>
AllowOverride All
</Directory>
It works fine on other domains on the same server. What did i do wrong and how can i fix it?
Thanks in advance!
More posts by @Hamm4606531
1 Comments
Sorted by latest first Latest Oldest Best
You need to remove the commented out server alias declaration. By commenting it out the only domain string that would use this vhost file is domain.com. You will probably find that the domain that the www domain is being redirected to is in the default configuration for the server where all connections not specifically handled by vhost files are directed to.
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.