
When our servers display an error page to your visitors, the default page is terse and not very helpful.
You can change these error pages so they're more useful and match the rest of your site in appearance. For example, you could change the "Not Found" page to show a "site map", helping your visitor find the correct page.
You can easily change several different error pages:
.htaccess file that has syntax errors.Note that each page has a three-digit error number (such as "404" for "Not Found").
Once you've decided which error pages you want to customize, create a normal Web page with your custom text and name it error401.html, error403.html, error404.html, error412.html, error500.html, or error503.html, as appropriate (using the error numbers shown above). Then upload or publish the page(s) to the top level of your Web page directory, using FTP or FrontPage just as you would publish any other Web page.
If you want to use server-side includes in your error pages, you can make your error pages be ".shtml" pages instead: just name them error401.shtml, error403.shtml, error404.shtml, error412.shtml, error500.shtml, or error503.shtml.
In the same way, if you want to use PHP for your error pages, name them error401.php, error403.php, error404.php, error412.php, error500.php, or error503.php.
That's all it takes! If you have trouble, make sure the file names are all lowercase, and that they end in ".html", ".shtml" or ".php", and not ".htm".
If you use any graphics or links in an error page, don't use "relative links" — instead, make all your links "absolute links" that start with "http://www.example.com/...". The reason for this is that your error document might be called into service from a variety of different locations on your site, depending on where the error occurs. Relative links point to locations that are relative to the current page (hence the name), but you don't know what the current page will be when your error document is displayed. Forcing your links to start with "http://www.example.com/" guarantees they're correct no matter what page the visitor was originally trying to view.
The errors mentioned above aren't the only possible errors that a Web server can display, although they're by far the most common. There are ways to override other error codes, too, if you're an expert user with experience with Apache ".htaccess" files. The Apache ErrorDocument directive explains how to do it.
Microsoft Internet Explorer has an inexplicable "feature": if a Web server sends a custom error page that is shorter than 512 bytes in size, Internet Explorer shows its own internal error page instead of the one from the server. Microsoft calls this "friendly HTTP error messages".
You can turn this "feature" off in your Web browser (search the Web for "Show friendly HTTP error messages" to see how), but you probably want to make sure that other people don't encounter it. To do that, just make sure your custom error pages are larger than 512 bytes in size (including the HTML tags and so forth). You can use invisible HTML comment text if necessary.
In practice, most custom error pages will be longer than 512 bytes anyway, so this isn't usually a problem. Our customers usually only encounter the problem when using a very short test phrase, in which case it can be very puzzling.