>>I am hosting several web sites at the same IP address and I don't intend
>>to provide a default host.
>>I am not quite sure what HTTP error code to generate. Several candidates
>>look like they may be appropriate, e.g.,
>>501 Not Implemented
> Don't just go by the title of the error code.
I didn't. But RFC 2068 (this is the authoritative source in this regard,
no?) doesn't really go into too much detail explaining all the possible
scenarios for the specific codes. E.g., for code 409, an example is
given (a PUT with "bad" data), but nothing is said about other possible
scenarios where a 409 may or may not be appropriate.
The definition given for 501 is even less verbose. It does seem to
indicate that the chosen request method, i.e., HEAD, GET, PUT, etc. is
not supported, but without any explicit statement, one could possibly
make an argument that "method" might be used in a wider sense, e.g.,
"the method the URI is formatted". I acknowledge that this was my
weakest candidate, but that's what have the experts in Usenet for, to
explain the details, right? ;-)
Quote:> "Not Implemented" and "Conflict"
> have very specific meanings that are not appropriate to your situation. Check
> the HTTP/1.1 spec for details.
Well, taken at face value (and without possibly existing commentary),
things don't seem to be so clear (at least to me.) Can anyone recommend
an (authoritative) commentary on this RFC?
Quote:> That will give you a 403, which is appropriate. Alternatively,
> [...] a 404, which would also be appropriate.
I really don't want to use 404 in this context. While perhaps formally
appropriate, it is usually generated for broken links, ill-configured
servers, unmaintained default configurations, etc. Something similar
(although to a much lesser extend) could be said about 403.
However, the message I am trying to convey is different, i.e., "I am
intentionally not returning any content here, because you are supposed
to use a FQHN in your URI. Since multiple hosts can be reached at this
address, using a numeric IP address as the host name would lead to
ambiguities. Please figure out which host you want and then come back."
Perhaps there is no perfect code for my situation. Right now I am
leaning towards either using 403 or 200, each accompanied by an
Thanks for the input,