How do I create a custom error page?

2004-06-19 23:47:01
How to create custom error pages such as 404 - File Not Found

There are two options,
In cpanel click on "Error Pages" and then select the type of error and create a page in their editor.

Make a .htaccess file. Put this inside:

ErrorDocument 404 /404.php 

(.php can be .html or anything else)

2. Now make a file called 404.php (or .html if you changed it). In this file put whatever you want the 404 page to be, normally this would look exactly like your design and have a user friendly message.

3. Now upload 404.php and .htaccess to the main part of your directory.

Now you have a custom 404 page. You can also do this with other errors by changing the number (ie 500 - script config error, 403 - access not allowed, etc).

FRONTPAGE USERS: FrontPage users SHOULD NOT upload an .htaccess file because FrontPage will not install if you have this file, or your site could break.

PASSWORD PROTECTION USERS: If you set up your site with password protection, this feature also uses the .htaccess file. Therefore, if you decide to add the customer error page feature, instead of creating a new .htaccess file - add the above line to your existing .htaccess file to activate the custom error page feature.

Page: 1
return to top