Correct http error code for unconfigured virtual hosts

Saturday, December 1. 2007, 14:44
Yesterday I did some maintenance of our server configuration and wondered what would be the correct way to handle unconfigured virtual hosts. E. g. what http-response should come if someone just enters the IP of our server or a domain that just isn't used for http.

At the moment, we're shipping a html-page explaining that it's an unconfigured domain, which is probably okay, but we ship it with HTTP code 200 (which means »OK«). I thought it should probably ship with some kind of error code so that search engines know there's no real webpage.
Now, reading RFC 2616 (HTTP 1.1) didn't answer the question to me. Most near is probably a 404, others we considered were 403, 503 or 204, but non of them seems to really match that situation. Maybe I should write some enhancement request to the IETF...

Comments appreciated, what would you think would be the correct status.

Trackbacks

No Trackbacks

Comments
Display comments as (Linear | Threaded)

It might not be an error code of the 200-range, as this would indicate that everything is fine (especially 204 is inappropriate, as there is in fact content). The 500-range is designed for server errors, and a missing configuration is definitely a server error. Every 400-statuscode reacts on a wrong client request, so we can ignore that. 503 is not ok, because a missing configuration is not temporary. It is not due to maintainance and therefore will not automatically go away after a certain delay. So there is just 501 or 500. 501 is more for specific HTTP-method errors so I would vote for 500.
#1 Lars Strojny (Link) on 2007-12-02 12:08
Und dies ist ein Beispiel wie man es vielleicht besser nicht macht: http://80.67.17.167/
(DomainFactory)
#2 Alex (Link) on 2007-12-02 13:38

Add Comment

Enclosing asterisks marks text as bold (*word*), underscore are made via _word_.
E-Mail addresses will not be displayed and will only be used for E-Mail notifications.