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

Possible Duplicate:
Domain without the 'www.' gives me the Apache 'It works!' page

I have included a copy of my virtual host file for apache below. (However I have hidden the ip address and domain name for now)

My problem is that the following work: www.mydomainnamehere.org www.mydomainnamehere.com mydomainnamehere.com

This one doesn't work: mydomainnamehere.org - instead of going to the document root listed below, it goes to the document root of the default site.

What could be causing this?

<VirtualHost [ipaddresshidden]:80>
ServerAdmin webmaster@mydomainnamehere.org
ServerName mydomainnamehere.org
ServerAlias www.mydomainnamehere.org
ServerAlias mydomainnamehere.com
ServerAlias www.mydomainnamehere.com
DocumentRoot /home/www/mydomainnamehere.org/html/
ErrorLog /home/www/mydomainnamehere.org/logs/error.log
CustomLog /home/www/mydomainnamehere.org/logs/access.log combined
</VirtualHost>
share|improve this question

marked as duplicate by Mark Henderson Sep 9 '11 at 5:41

This question has been asked before and already has an answer. If those answers do not fully address your question, please ask a new question.

    
Just a tip, use one ServerAlias line with each additional domain separated by a space. –  Warner May 22 '10 at 17:06
add comment

2 Answers

First, let's get the most obvious things out of the way.

  1. Did you restart apache after adding mydomainhere.org ?
  2. Have you tried this in a different browser? Sometimes browsers cache the default home page very aggressively.
  3. What is the ServerName in the default httpd.conf? Is there a conflict in servernames by any chance?
share|improve this answer
add comment

I had this problem too, and found my solution here.

Basically, after an upgrade, Apache put a symlink in /etc/apache2/sites-available. Deleting everything between and including <VirtualHost *:80> and <VirtualHost> got everything working for me again.

share|improve this answer
add comment

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