Knowledgebase: How-To
Handling Apache Errors
Posted by on 02 July 2012 12:49 PM

Handling Server Errors

Several options exist for handling web server errors. For example, rather than showing the standard ugly error page that pops up when you reach a website that doesn't currently exist you can make your error page pretty! Useful! Fancy!

Default

The default method, when using the "Error Pages" option in the cPanel Control Panel, are SSI files. This creates files for each type of http error. See the Control Panel for additional details and use.

Others

It may be desired to write these error handlers in a different language, such as PHP, as shown below.

Using .htaccess

This example will assume a PHP error handler, and assume the root directory of the domain. The filenames of these files can be anything you choose. So within .htaccess place the (or an edited version of) the following:

ErrorDocument 404 /404.php

Now all 404 errors (requests for missing files) will redirect to a file named 404.php and then this file (404.php) can do whatever you wish like show a sitemap, or simply say "Sorry." Each domain or subdomain can have their own.


(0 vote(s))
This article was helpful
This article was not helpful

Comments (0)
Post a new comment
 
 
Full Name:
Email:
Comments:
Help Desk Software by Kayako fusion
ERROR: This domain name (kb.asmallorange.com), does not match the domain name in the license key file help.asmallorange.com.

For assistance with your license, please contact the Kayako support team: https://support.kayako.com