Making Error Message Look Better
When designing a Web page, you want to be as helpful to your viewers
as possible. For instance, it's one thing to tell the bumble-heads that they entered the wrong address into their
browsers with the standard error message. It's another thing to display a nice, understanding message that gives
them a better idea of where they might have gone wrong, or at least direct them in the right direction.
You can add a custom message to your site by simply changing the ErrorDocument directive in the server settings.
To do so, first create the replacement page you wish to display when the viewer enters the wrong address. For our
example, name the file Oops.htm. Now, launch your server connection and locate the text file named .htaccess. Open
the file, and enter the following:
ErrorDocument 500 Oops.htm
ErrorDocument 404 Oops.htm
ErrorDocument 401 Oops.htm
ErrorDocument 403 Oops.htm
Save the file and you're done. From this point on, whenever a viewer
of your Web site evokes one of the errors, he'll be transported to the file Oops.htm. Or if you'd like, you can
change the .htaccess file so that each error displays its own custom page.