Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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 I have 2 virtual hosts :


DocumentRoot "C:/webroot/domainA"
ServerName domainA.com
ServerAlias www.domainA.com         

DocumentRoot "C:/webroot/domainB"
ServerName domainB.com
ServerAlias www.domainB.com         

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....

share|improve this question

1 Answer 1

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

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.