When does the standard 404 page appear?

I am creating a simple HTTP server for a project. Most websites have custom 404 error pages. Sometimes, however, you will see that Firefox spits on a common 404 page (or 405, etc.). How does he decide what to do? What should be the HTTP response? Is "HTTP / 1.0 404 NOT FOUND" Enough?

thank

+3
source share
5 answers

Thus, Firefox will not display a 404 common error page in most cases; you are thinking of Internet Explorer, which ignores the 404 page of the site if it is below a certain size and displays it.

+1
source

(, -), HTTP/1.0 404 NOT FOUND HTTP.

, . , 404 .

.

:

<HTML>
<head>
<meta HTTP-EQUIV="Refresh" CONTENT="5; URL=not404.htm">
</head>
</HTML>

404 .com

+4

HTTP-, RFC, : http://www.faqs.org/rfcs/rfc2616.html

404 :

Request-URI.

. 410 (Gone) , , , . , , .

, , .

, HTTP-. question , HTTP- C ++, ,

+2

It is true to return the html body with a response code of 404. If the body is not specified, the browser will display the default page.

  • If you send only HTTP / 1.0 404 NOT FOUND then the browser screen is displayed.
  • If you add the body to the response, the browser will mainly use this.
+2
source

Usually it is configured on a web server, that is: when the server receives 404, send it to this page.

-2
source

Source: https://habr.com/ru/post/1698315/


All Articles