July Design Studio

Web Advisor » Custom Error Pages

Custom Error Pages

 
 

Why create a custom error page?

  1. Visitors get errors for various reasons. Even if there are no broken links in your web site a visitor may misspell a url and get a page not found Error 404.
  2. It retains your web site branding
  3. Shows visitors they are still on the same web site
  4. Can be a useful navigation tool and help keep visitors on your web site

Error Page has to have the following information:

  • Branding and main navigation links
  • Brief message explaining the error
  • Suggesting for visitors that they should check the link
  • Brief paragraph about your web site
  • Search box
  • Site map
  • An email link to your webmaster

*Don't use the word "error", it can scare off webpage visitors.

List of Errors
 Error Code  Label
 400  Bad Request
 401  Authorization Required
 403  Access Forbidden
 404  File Not Found
 500  Internal Server Error

How to create a custom error page:

  1. Create all the custom error pages you need for your site and save them in a folder called /errors/ as error404.html
  2. Go to the main root directory of your web site and look for a file called .htaccess (If you have the file, you need to edit it, If you don't have the file, create a new text document and save it as ".htaccess")
  3. Add/edit the following line: ErrorDocument 404 /errors/error404.html
    • the text needs to remain exactly as above
    • stay on one line
    • keep a space on both side of the number 404
    • use the uppercase for the E and D in ErrorDocument (it's case sensitive)
  4. Add any other errors for the pages you have created
  5. Save .htaccess
  6. Publish the .htaccess file to your root site directory
  7. Publish your custom error pages
  8. Test it to see if it works on your web site by typing in an erroneous url