web hosts that support custom error
pages provide an easy to use
control panel to help create and
manage customizable error pages.
For those web hosts that do not have
an easy method to create and manage
custom error pages, you still may be
able to setup custom error pages
using a .htaccess file.
Create a plain text file using a
text editor such as Windows Notepad.
Add the following text...
deny from all
ErrorDocument 404 /home/user/public_html/404.shtml
first 4 lines prevents people from
viewing your .htaccess file.
- The last line tells Apache to
redirect all 404 errors to the
Save the file as a plain text
file. Name the file ".htaccess"
Upload the .htaccess file in
ASCII mode to your web space using
an FTP application.
Create a 404.shtml page using
your favorite web page creation
automatically redirect to the home
page. This may annoy some
friendly error message. Use a more
informal tone. "Oops! This page
must have been deleted or moved."
- Include your site map on the
a method for visitors to easily
contact you on the error page such
as a contact form or chat script.
the referring page via the
HTTP_REFERER server variable.
Notify webmasters of these sites
that the link is no longer valid.
To prevent search
engines from spiddering your error
pages, add the following line
between the <head> and </head>
tags on the error page:
<META NAME="ROBOTS" CONTENT="NOINDEX,
Upload the 404.html page to the
same location as listed in your .htaccess
Try it out. Go to a page on your
site that does not exist.