my httpd.conf looks like this:
NameVirtualHost *:80
<VirtualHost *:80>
DocumentRoot /var/www/host1.com
ServerName host1.com
ServerAlias www.host1.com
</VirtualHost>
<VirtualHost *:80>
DocumentRoot /var/www/host1.com/subdomain
ServerName subdomain.host1.com
ServerAlias www.subdomain.host1.com
</VirtualHost>
<VirtualHost *:80>
DocumentRoot /var/www/host2.com
ServerName host2.com
ServerAlias www.host2.com
</VirtualHost>
So, everything works like it should except:
host2.com shows /var/www/host1.com/
whereas
www.host2.com shows /var/www/host2.com/
I'm pretty sure this is an Apache config problem, but I can't figure it out. Any help??
try in this way
DocumentRoot /var/www/host2.com
ServerName www.host2.com
ServerAlias *.host2.com