By using this site you agree to the use of cookies.

Learn more

Share via:


HTTP 404 Not Found

The HTTP 404 status code indicates that the requested resource could not be found.

Edited: 2018-01-14 00:55

Servers deliver a HTTP 404 Not Found header response code when a requested resource was not found. An example of how a server would respond if a file was not found can be seen below:

HTTP 404 Not Found

This Response code would often be send together with a message body, containing a custom error page describing to the user what went wrong. Custom error pages can include a search field, or suggestions to what the user might be looking for.

Problems with 404 error pages

Its important that the correct header status code is delivered, along with the error page itself – as there is no reliable alternative method in the HTML, that is understood by search engines. So-called soft 404 errors will not work.

A custom error page must be larger than 512 bytes to avoid problems with certain browsers and plugins, which will otherwise replace the error page with their own.

404 or 301 redirect to homepage

There is some debate in the SEO community as to whether you should redirect deleted pages to the homepage, or leave them deleted, which would correctly produce a 404 error message. Generally, it does not make sense to redirect deleted content, because users do not expect to be pushed silently around without any explanation as to what happened, or why they are not seeing the content they actually requested..

There are circumstances where you might want to show users to a different page, explaining that the content has been deleted. This page could show the user related or similar content to what they were requesting. But it would be semantically incorrect to use a 301 redirect for this purpose. Instead, you should correctly output a 404 error message, explaining that the content has been deleted. It is also possible to show links to "related" or "similar" content on 404 error pages.

Whether your CMS has this functionality already implemented is another matter.

If a the page you are deleting has a lot of incoming links, you should still consider deleting it correctly, and throwing a 404 error rather than 301 redirecting it to your homepage.

See also

  1. Creating a Custom Error Page – How to create a custom error page
  2. HTTP Response Codes – A list of HTTP Response Codes
  3. PHP Header – How to deliver status codes with PHP