Main Menu
Home
Standard Hosting Package
Extras
Installation
Domain Names
About Dogsbody Hosting
Contact Us
Showcase
Usage Policy
Service Agreement

Customer Menu
Webmail
phpMyAdmin
- - - - - - - - - - - - - - - - - - - - -
Support FAQ

Webmail Login
Username

Password

Your Location Home arrow Support FAQ arrow Webspace arrow How do I customise my '404 page not found' errors?
How do I customise my '404 page not found' errors? Print

As you have probably seen through other faq questions the key to most webpage customisations is with your .htaccess file, here is a simple step by step guide...

Create a directory called 'errorpages' in your 'web' directory (it can be called whatever you want but this name works well as an example).

There are a number of error codes that you can make errorpages for however in practice you only need a few. HTTP status codes are divided into five groups...

  • 1xx: Informational - Request received, continuing process.
  • 2xx: Success - The action was successfully received, understood, and accepted.
  • 3xx: Redirection - Further action must be taken in order to complete the request.
  • 4xx: Client Error - The request contains bad syntax or cannot be fulfilled.
  • 5xx: Server Error - The server failed to fulfill an apparently valid request

...you don't need to create errorpages for any of the 1xx, 2xx or 3xx codes as pages have been returned properly. In practice you should only really need to make pages for the codes...

  • 400 : Bad Request
  • 401 : Unauthorized
  • 403 : Forbidden
  • 404 : Not Found
  • 405 : Method Not Allowed
  • 500 : Internal Server Error
  • 501 : Not Implemented

A full list of codes can be found in RFC 2616 should you wish to investigate.

Create HTML files for each of your errorpages and put in your errorpages directory.

If you haven't already got one create a '.htaccess' file in your web directory and add a line for each errorpage you created such as...

ErrorDocument 400 /errorpages/400.html
ErrorDocument 401 /errorpages/401.html
ErrorDocument 403 /errorpages/403.html
ErrorDocument 404 /errorpages/404.html
ErrorDocument 405 /errorpages/405.html
ErrorDocument 500 /errorpages/500.html
ErrorDocument 501 /errorpages/501.html

...(remember to ftp your .htaccess file as ascii) and you should be done. Try it by calling a page you know doesn't exist.


 

Search This Site

Latest News
  • Bid for Middle East peace begins
    The US Secretary of State tells the Israeli and Palestinian leaders they have the "opportunity to end this conflict" as direct peace talks begin.
  • Pakistan trio hit by ICC charges
    The three Pakistan cricketers accused of corruption - Salman Butt, Mohammad Asif and Mohammad Amir - have been charged, and provisionally suspensed, by the International Cricket Council.
  • PM backs Hague over aide rumours
    David Cameron supports William Hague "100%" following speculation about the foreign secretary's private life, the PM's spokeswoman says.
  • Explosion on Gulf of Mexico rig
    An explosion rips through an offshore oil rig in the Gulf of Mexico, west of the site of the blast in April that caused a huge oil spill.
  • Ministers propose 45p drink price
    The Scottish government says drinkers should be charged a minimum of 45p for every unit of alcohol as part of efforts to cut consumption.
  • Strike 'kills Afghan civilians'
    Ten election campaign workers have been killed in an air strike by Nato-led forces in Afghanistan, Afghan officials say.
  • RBS to cut a further 3,500 jobs
    Royal Bank of Scotland is planning to cut 3,500 jobs from its technical and back office division.
  • Burger King is sold for $3.26bn
    Burger King is being sold to private equity firm 3G Capital in a deal valued at $3.26bn (£2.1bn), it has been announced.



Copyright © 2003-2010 Dogsbody Hosting