Home
 

Customer Support

Search for keywords:

Browse by category:

How do I make my own Error Documents to replace the
default ones like 404 Not Found?

You can make your own error pages by creating the html files that you want displayed for each error code and by designating them in an .htaccess file in your www directory.

For example, if you want a web page called 404.html to replace the default error page, put the following line in your .htaccess file:

ErrorDocument 404 /404.html

You can do the same with other error codes. Be sure that the filename of the web page that you designate in your .htaccess file is the name of an actual web page that you have created and uploaded.

Since this error page will be loaded from any directory on your site, remember to make any link or image path root relative images/myimage.jpg as opposed to images/myimage.jpg.

Check out the Apache documentation on ErrorDocument directives.

Also, this A List Apart article has some helpful tips as well.

User-Contributed Notes

add a note
mark -at- smallplanetonline.com
17-Apr-2002 10:12
One of the features of newer Microsoft browsers is the "Friendly 404
Error" page which overrides any custom 404 page that is smaller than 512
bytes.  Make sure your custom 404 page is over 512 bytes. Adding a
graphic is an easy way to make sure you're over the minimum size.

09-Apr-2003 11:57
If you find that an .htaccess file already exists, just add your new
directives either before or after the ones that are already there.

09-Apr-2003 11:57
You must create the file named ".htaccess". It is just a plain text file
and you put directives on it one per line.

add a note

Related Questions:


Why does my website just say "Error 403 Forbidden"?

How do I protect a directory with .htaccess?

How can I show a default page other than index.html?

How do I stop people from getting directory listings when I dont have an index page?

What do the different HTTP Status Codes like 200, 304, 404, 401, 403 mean?

What options are configured with Apache and what can I do with .htaccess files?

How do I protect a directory with mod_auth_mysql?

How do I stop other websites from using my bandwidth while they steal images, flash, etc. from my site?

Which Apache modules are installed?

How can I make apache recognize different MIME types?

The webservers' Gzip compression is messing up my XML or Flash files for Netscape 4 browsers. How do I turn off compression?

How do I get different character sets to display correctly?

What webserver do you run?

Will I have access to raw logfiles?

I created a symbolic link, and now I am getting a 404 errors.

How do I stop the server from automatically correcting spelling mistakes in URLs or offering multiple choices for documents?

My mod_rewrite rules make my website stop loading.

Why am I getting a 412 Precondition Failed from a website?

How do I protect my website from comment spam?

How do I enforce the use of SSL on my website?

How do I redirect traffic to another web page?

Browse Categories:

Getting Started, FTP, Telnet/SSH, Moving Domains, E-mail, Traffic Reports, Mailing Lists, Apache, PHP, CGI, Other Server-Side Scripting, MySQL Database, Imaging Libraries, Other Software, Billing & Terms, Control Panel, E-commerce, Pre-Sales


Tiny Modwest Logo         Copyright 2000-2008 by Modwest, Inc.          About Us    |    Blog    |    Jobs    |    Web Design    |    Contact Us