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.

I realise this question has been asked tons of times before on the forum but I've eliminated all the usual suspects in my case and still Im not having much luck with this problem.

The www.mydomain.net works fine but the mydomain.net takes me to the Apache test page.

Here's my DNS entries

A        mydomain.net          123.456.244.456
CNAME    www.mydomain.net          mydomain.net           

Here'e my apache config:

ServerName www.mydomain.net
ServerAlias  mydomain.net

RewriteEngine on
RewriteCond %{HTTP_HOST}   !^www\.mydomain\.net [NC]
RewriteCond %{HTTP_HOST}   !^$
RewriteRule ^/(.*)         http://www.mydomain.net/$1 [L,R]

copied straight from the Apache docs.

The interesting thing is that mydomain.net ALWAYS goes to the apache test page. Regardless of whether I make it a ServerName or ServerAlias.

share|improve this question
    
I find it strange the mail V host is www it is generally done the opposite way. –  Jacob Mar 16 '11 at 2:47

1 Answer 1

up vote 2 down vote accepted

Are you using virtual servers on Apache? If so, there may be a default site configured that is causing any domain not 'www.mydomain.net' to be handled by the default handler. As a quick check, try abc.mydomain.net and see if you get the apache test page.

share|improve this answer
    
Yes that was right. I had a default site config that was placed under sites-enabled by apache that I had not taken out. Did not realize that could be the problem. Still not sure why that would be the case. –  UDIT MANEKTALA Mar 16 '11 at 3:04

Your Answer

 
discard

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.