How to install Custom Error pages on your site.

This is pretty straight forward if your host uses Apache and allows you to use custom error pages. I suspect most do, although I'm not sure about Dot.Mac although I suspect it is possible. If I find out any information, I will add it.

There are a lot of errors which can happen, but here is a list of the main ones:
  • HTTP Error 400 - Bad request
  • HTTP Error 401 - Unauthorized
  • HTTP Error 403 - Forbidden
  • HTTP Error 404 - Not found
  • HTTP Error 500 - Internal server error
A full list is available at W3.org.

The page location is a key to making these work. They must reside in the root directory for site wide use and have a suffix of .shtml. For instance, a custom error page for error 404 would be "404.shtml".

To locate the page, on the Page Inspector / General Settings, enter a slash ("/") in the Folder field. Enter the appropriate file name in the Filename field (ie: "404.shtml").

To "echo" information about the request, you can include one or more of the following:

HTTP_REFERER: <!--#echo var="HTTP_REFERER" -->
REDIRECT_STATUS: <!--#echo var="REDIRECT_STATUS" -->
HTTP_USER_AGENT: <!--#echo var="HTTP_USER_AGENT" -->
HTTP_HOST: <!--#echo var="HTTP_HOST" -->
REQUEST_URI: <!--#echo var="REQUEST_URI" -->
REMOTE_ADDR: <!--#echo var="REMOTE_ADDR" -->

These will return the following information:
HTTP_REFERER: (none)
REDIRECT_STATUS: (none)
HTTP_USER_AGENT: CCBot/2.0 (https://commoncrawl.org/faq/)
HTTP_HOST: tutorials.think-different.com
REQUEST_URI: /error_pages/how_to.shtml
REMOTE_ADDR: 35.173.42.124

You can also use a redirect to send your lost visitors back to your home page. You would need to add a redirect meta tag to each error page. It would look like this:

<META HTTP-EQUIV="Refresh" CONTENT="5; URL=html-redirect.html">

The "5" means to wait 5 seconds before redirecting. The "html-redirect.html" after "url=" is the URL of the page to which to redirect.

You can enter the redirect code either in the Meta Tags area or in the Custom Header area. The benefit to the later is that it is a bit easier to see and edit, but will not be included in the Apply To All Pages (Headers), which would be a problem.

If adding your custom pages does not work automatically, you may need to access your host settings page (cPanel on my host). You should find a link to Error Pages (or something similar) where the host allows creating custom error pages. Add anything to the code area (if the area is empty), save, and upload your pages again. If you repeat this, you should see your RW code in the code area.

There are a number of sites which display unique custom error pages. Try searching Google.