1

Hello and sorry if this is a duplicate, just couldn't find the answer... So i own domainA.com and domainB.com (from Godaddy). I forward both to my static ip. Web server is apache 2.2.23 with local ip of 192.168.2.5. I have 2 virtual hosts :

NameVirtualHost 192.168.2.5

<VirtualHost 192.168.2.5:80>
DocumentRoot "C:/webroot/domainA"
ServerName domainA.com
ServerAlias www.domainA.com         
</VirtualHost>

<VirtualHost 192.168.2.5:80>
DocumentRoot "C:/webroot/domainB"
ServerName domainB.com
ServerAlias www.domainB.com         
</VirtualHost>

For some reason, if i visit domainB.com, domainA.com takes over. I edited each CNAME for www:

domainA.com : www -> domainA.com
domainB.com : www -> domainB.com

But I'm not too sure about this part....

Eric
  • 81
  • 1
  • 10

1 Answers1

1

Ok figured it out. I had to add NameVirtualHost and remove the www -> domainA.com and use @ instead.

Eric
  • 81
  • 1
  • 10