• Martin Thoma
  • Home
  • Categories
  • Tags
  • Archives
  • Support me

Custom 404 error pages

Contents

  • Custom 404 error pages
    • How to create a custom 404 error page
    • Good examples
    • Further Reading

404 Not Found A 404 http status code means that no document could be found at the given URL. The reason could be a misspelled URL or moved content.

Anyway, the user needs help now. The standard error page doesn't provide much information, so you should create a custom one.

If you like more information, just Google for "custom 404 page".

How to create a custom 404 error page

Simply add the following line to your .htaccess file:

ErrorDocument 404 /notfound.php

(This will work only on an Apache webserver, of course).

Now you have to create a notfound.php file. This file should provide the following information:

  • Tell the user that he typed a wrong URL or that the link pointed to a target which doesn't exist
  • Provide a search box
  • Provide a link to a graphical sitemap
  • Provide some funny / interesting content
  • Make sure that a 404 http status code is still returned after your changes

Good examples

  • 60 Really Cool And Creative Error 404 Pages
  • 36 Cool Custom Error 404 Pages
  • 404 Error Pages: Reloaded

Further Reading

  • 404 Error Pages .com
  • Wikipedia

Published

Okt 22, 2011
by Martin Thoma

Category

The Web

Tags

  • Web Development 14

Contact

  • Martin Thoma - A blog about Code, the Web and Cyberculture
  • E-mail subscription
  • RSS-Feed
  • Privacy/Datenschutzerklärung
  • Impressum
  • Powered by Pelican. Theme: Elegant by Talha Mansoor