LetsPlayYahtzee
LetsPlayYahtzee

Reputation: 7581

HTTP status code for not resolved url

Maybe this is an opinion based question, maybe not, I am not sure so I'll ask.

I am implementing a simple proxy server. Which is the most appropriate error code for the proxy to return when a url that does not resolve to anything is requested?

After some search I came to the understanding that there is not a standard http code for this occasion, maybe this is due to the fact that for a server it's hard to determine what is the cause of not being able to resolve a url.

The closest to meaningful status codes I have found are the

and

but in my understanding both imply that the url was found in the dns.

Upvotes: 1

Views: 3882

Answers (2)

David Clews
David Clews

Reputation: 906

Use HTTP Code 0 Unreachable

Make sense since there is nothing to retrieve

Upvotes: 0

Maxime Mangel
Maxime Mangel

Reputation: 1996

I would use 404 status code:

404 Not Found:

  • The requested resource could not be found but may be available in the future.

But I am not sure, this is what you whant.

Upvotes: 2

Related Questions