Revision 1098257 of 404 Not Found

  • Revision slug: Web/HTTP/Status/404
  • Revision title: 404 Not Found
  • Revision id: 1098257
  • Created:
  • Creator: Jeremie
  • Is current revision? No
  • Comment

Revision Content

{{HTTPSidebar}}

The HTTP 404 Not Found client error response code indicates that a server can not find the requested resource. This response code probably is most famous one due to its frequency to occur in the web. These are often called broken or dead links and lead to link rot.

A 404 status code does not indicate whether this lack is temporary or permanent. If the server knows that this condition is likely to be permanent, a {{HTTPStatus(410)}} (Gone) should be used instead of a 404 status.

Status

404 Not Found

Custom error pages

Many web sites customize the look of a 404 page to be more helpful to the user and to provide guidance. Apache servers can be configured using an .htaccess file and a code snippet like this one, for example.

ErrorDocument 404 /notfound.html

You can take MDN's 404 page as inspiration.

Note: 404 pages design is an endless source of inspiration, but be aware it also exists a set of best practices to make those pages useful for web site users.

Specifications

Specification Title
{{RFC("7231", "404 Not Found" , "6.5.4")}} Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content

Browser compatibility

{{Compat}}

See also

  • {{HTTPStatus(410)}}
  • {{interwiki("wikipedia", "HTTP_404", "Wikipedia: HTTP 404")}}

Revision Source

<div>{{HTTPSidebar}}</div>

<p>The HTTP <code><strong>404</strong></code><strong><code> Not Found</code></strong> client error response code indicates that a server can not find the requested resource. This response code probably is most famous one due to its frequency to occur in the web. These are often called broken or dead links and lead to <a href="https://en.wikipedia.org/wiki/Link_rot">link rot</a>.</p>

<p>A 404 status code does not indicate whether this lack is temporary or permanent. If the server knows that this condition is likely to be permanent, a {{HTTPStatus(410)}} (Gone) should be used instead of a 404 status.</p>

<h2 id="Status">Status</h2>

<pre class="syntaxbox">
404 Not Found</pre>

<h2 id="Custom_error_pages">Custom error pages</h2>

<p>Many web sites customize the look of a 404 page to be more helpful to the user and to provide guidance. Apache servers can be configured using an <code>.htaccess</code> file and a code snippet like this one, for example.</p>

<pre class="brush: bash">
ErrorDocument 404 /notfound.html</pre>

<p>You can take <a href="https://developer.mozilla.org/en-US/404">MDN's 404 page</a> as inspiration.</p>

<div class="note">
<p><strong>Note:</strong> 404 pages design is <a href="https://www.google.fr/search?q=awesome+404+pages">an endless source of inspiration</a>, but be aware it also exists <a href="http://alistapart.com/article/perfect404">a set of best practices</a> to make those pages useful for web site users.</p>
</div>

<h2 id="Specifications">Specifications</h2>

<table class="standard-table">
 <tbody>
  <tr>
   <th scope="col">Specification</th>
   <th scope="col">Title</th>
  </tr>
  <tr>
   <td>{{RFC("7231", "404 Not Found" , "6.5.4")}}</td>
   <td>Hypertext Transfer Protocol (HTTP/1.1): Semantics and Content</td>
  </tr>
 </tbody>
</table>

<h2 id="Browser_compatibility">Browser compatibility</h2>

<p class="hidden">The compatibility table in this page is generated from structured data. If you’d like to contribute to the data, please check out <a href="https://github.com/mdn/browser-compat-data/README.md">https://github.com/mdn/browser-compat-data/README.md</a> and send us a pull request.</p>

<p>{{Compat}}</p>

<h2 id="See_also">See also</h2>

<ul>
 <li>{{HTTPStatus(410)}}</li>
 <li>
  <p>{{interwiki("wikipedia", "HTTP_404", "Wikipedia: HTTP 404")}}</p>
 </li>
</ul>
Revert to this revision