Reputation: 431
Sorry if this sounds stupid, its how I feel since I've done this in the past and can't figure out whats wrong.
Anyways, I had two sites setup on my fedora linux box, now I'm trying to add a third site. However when I go to www.site3.com it gets redirected to the first site.
My VirtualHost code is very basic, please let me know what else I should be adding and any issues you can see which result to the issue I mentioned.
httpd.conf:
<VirtualHost *:80>
DocumentRoot /var/www/html/web/site1/
ServerName site.com
</VirtualHost>
<VirtualHost *:80>
DocumentRoot /var/www/html/web/site2/
ServerName site2.com
</VirtualHost>
<VirtualHost *:80>
DocumentRoot /var/www/html/web/site3/
ServerName site3.com
</VirtualHost>
Is there anything else I need to change other than this? The other first two sites still work fine, I've restarted the httpd service, but no avail
Thanks in advance
Upvotes: 0
Views: 602
Reputation: 943089
www.site3.com
and site3.com
are not the same hostname. See the ServerAlias directive.
<VirtualHost *:80>
DocumentRoot /var/www/html/web/site3/
ServerName site3.com
ServerAlias www.site3.com
</VirtualHost>
Upvotes: 2