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 know that similar questions have been asked, but the available answers are not very clear, so please bear with me.

After setting up a few <VirtualHost>s in apache, I'd like to configure the _default_ ServerName so that it returns the 404 message. I.e., unless some explicitly available domain is specified in the Host http header, return 404. (Ideally something more direct than pointing to a now-nonexistent directory.)

Any help would be greatly appreciated.

share|improve this question
add comment

1 Answer

up vote 9 down vote accepted

Did you try:

Redirect 404 /
ErrorDocument 404 "Page Not Found"

in the default VirtualHost?

share|improve this answer
    
Thanks, that did it! Since it's clear my low level of expertise, I might add for my fellow newbies that the default server should appear first. (This took me a while to figure out!) –  eze Feb 5 '11 at 13:25
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.