Issue with CNAME and Virtual Hosts
- by mrc0der
I'm using Apache and I have a CNAME DNS record for
sub2.sub1.domain1.com that points to sub1.domain1.com
And I have an A DNS record for
sub1.domain1.com that points to the IP.
Then in my httpd.conf file I have:
<VirtualHost *:80>
ServerName www.domain1.com
DocumentRoot /domain1/www
</VirtualHost>
<VirtualHost *:80>
ServerName sub1.domain.com
DocumentRoot /domain1/sub1/www
</VirtualHost>
Yet I appear to be missing something, as when you visit sub2.sub1.domain1.com, it shows you the page for domain1.com. When you visit the sub1.domain1.com, it shows the correct page for sub1.