Webmaster-Showcase.net Custom Error Pages

How to create a custom error page

Creating a custom error page is as easy as creating any HTML page. All you need to do is name the file correctly. The file must be named "e[error number].html". So, for the most common error number, 404 (not found), the file must be named "e404.html". This file must be in your home (or root) directory.

What are the error numbers?

Here are some standard server errors and their meanings:
Error Code Meaning
400 Indicates the syntax of the request was bad.
401 Authorization is rquired. The name/password provided with the request (if any) does not match an authorized person.
403 Forbidden. The request was understood but the server is not allowed to serve the resource that was requested.
404 Not found. The resource named is not present on the server.
406 Not acceptable. The client's request included some "accept" qualifications which were not met.
407 Proxy authentication required.
408 Request timeout. The server was waiting for the completion of the request and it took too long.
409 Conflict. Current server state prohibits fulfilling the request.
410 Gone. The requested resource is not available now nor is it ever likely to be available on the future.
411 Length required. The request needs to have a length value supplied by the client.
412 A condition specified in a request header was false.
413 Too large. The request entity was too large for the server.
414 Request URI too long. Longer than the server would accept.
500 Internal server error.
503 Service not available. The server can't fulfill the request at this time. Try again later.
This is not the complete list but you can see there are quite a few possible error codes. The Yahoo! WebHosting page about custom error pages only talks about error 401 and 404. These are the most likely errors that people may see when accessing your web site.

What should be on a custom error page?

That depends on the error code. Some useful information for someone who gets a 404 error are:
  • A suggestion to recheck the spelling
  • Links to some of the more important link pages on your web site
  • A form for searching your web site (see Personal site search)
  • Your email address so they can mail you if they think there is a problem
  • Other contact information - especially if this is a business or organization web site
For the 401 error you may include information on how to get a valid login/password to access the resource that was requested.

An example

<html>
<head>
  <title>401 Error</title>
</head>
<body background="/images/bg.gif" bgcolor="#FFFFFF" link="#0000FF" vlink="#000099" text="#000000"
>

<table border="0" cellspacing="0" cellpadding="0" width="400">
<tr valign="top" align="left">
    <td><img src="images/c.gif" height=1 width="70"></td>
    <td><img src="images/c.gif" height=1 width="150"></td>
    <td><img src="images/c.gif" height=1 width="150"></td>
    <td><img src="images/c.gif" height=1 width="30"></td>
</tr>
<tr valign="top">
    <td colspan="4" height=2></td>
</tr>
<tr valign="top">
    <td colspan=1 height="58" align="center" valign="middle"></td>
    <td valign="middle" align="center" colspan="1"><font face="Arial Black" size="+1"><span style="font-size:18">Webmaster-Showcase.net</span></font></td>
    <td valign="middle" align="center" colspan="1"><font face="Arial Black" size="+1"><span style="font-size:18">401 Error</span></font></td>
</tr>
<tr valign="top">
  <td colspan="3" height=17></td>
</tr>
<tr>
  <td colspan="1"></td>
  <td colspan="2">
<h1 align="center">Not Authorized</h1>
<p>
The name and password you provided does not match any authorized pair. If you were not provided a valid name and password pair by the owner of this web site then please stop trying to access the URL http://<!--#echo var="SERVER_NAME" --><!--#echo var="REDIRECT_URL" -->.
</p>
If you have previously been authorized but forgot, send an email request to <a href="mailto:owner@webmaster-showcase.net">the owner</a>
</td>
</tr>
</table>
</body>
</html>
Home
Show Me How Feedback
Last updated: Fri Nov 8 16:54:39 2002