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.

I have run into something I find odd. I am using Apache/2.0.54

If I try to access a non existent sub domain on my server it will resolve to the primary domain. For example going to

http://www.fakesub.mydomain.com

will resolve to http://www.mydomain.com .

If I enter a valid subdomain e.g.

http://www.validsub.mydomain.com

it will resolve to the proper sub domain.

I am thinking this is due to a server confg of some kind but I'm not sure what. Googling didn't really help me but that may be because I don't know what to call this exactly.

Could anyone suggest why this is happening? Thanks much!

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

On a NameVirtualHost enabled address/port combination, the first matching <VirtualHost> to load is considered the default; requests that match no other hosts are sent to it. See your current configuration with apache2ctl -S.

If you want to avoid this behavior, make the first to load a dummy vhost which serves no content.

share|improve this answer
add comment

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.