Databloc - cpanel web hosting
Call us toll free at 1-888-210-1714

The leading provider of top quality cpanel web hosting services.

Databloc Homepage   Shared Web Hosting Reseller Hosting Domain Registration SSL Certificates

Support

An error page is displayed when there is a problem processing the url you are trying to access. There are many types of error pages but most common is the 404 (file not found) error. When someone is trying to access a page on your site and either the page has been moved or the link was misspelled, both Internet Explorer and FireFox will display a generic error page. With this tutorial you can customize that page.

Note: If you using Frontpage Extensions on your web site, custom .htaccess files cannot be setup using this method.

Creating the Error Page

Custom error pages are just standard HTML pages. You can create a directory in your site, say 'errors' for example, and in it create a page for each error you want to use provide the custom page for. Call these simple names for clarity.

/error/401.htm
/error/404.htm
/error/500.htm

This will make them much easier to find and edit in future.

Creating The Access Control File

Databloc uses the Apache web server and therefore you need to create a .htaccess (yes, the dot should be there) file in the root web directory (/public_html). You may wonder what is an .htaccess, well it is simply a control file which is used by Apache. It allows you to control aspects of the server such as error pages. For more information on creating an .htaccess file see our Introduction To An ".htaccess" File article.

Using a text editor like Notepad simply create a file called .htaccess and add the following into it:
# Added for Custom Errors
ErrorDocument 401 /error/401.htm
ErrorDocument 404 /error/404.htm
ErrorDocument 500 /error/500.htm

It is important that you use the exact syntax above - for example 'ErrorDocument', not 'errordocument'. You can of course change the file paths to the correct ones for your site.

Uploading The Access Control File

Now, using an FTP client you need to upload the .htaccess file into your root web directory (/public_html). The file must be transferred in ASCII (plain text) mode.

Testing Your Error Pages

To test your newly created error pages simply visit your web site and type in a url that you know does not exist. If your custom error page is displayed then everything is working.
Web Hosting with cPanelPHP4, PHP5 and PHP6MySQLCGI, PerlEnhanced Frontpage ExtensionsRuby On Rails (ROR)Fantastico Enabled
Shared Web Hosting | Reseller Hosting | Domain Registration | SSL Certificates
Customer Support | Terms of Service | Acceptable Use Policy | About Us | Sitemap