Home arrow Apache arrow Page 3 - Custom Error Pages with Apache

Internationalized error pages - Apache

Nobody enjoys seeing an error page. It's worse if the error page gives you little or no information to help you find the page you were trying to reach. Fortunately, there are ways to configure Apache so that your visitors need never feel so abandoned. This article explains how to set up custom error pages with Apache.

TABLE OF CONTENTS:
  1. Custom Error Pages with Apache
  2. Creating a custom error page
  3. Internationalized error pages
  4. Maintaining and updating error pages
By: Dan Wellman
Rating: starstarstarstarstar / 13
April 03, 2006

print this article
SEARCH DEV SHED

TOOLS YOU CAN USE

advertisement

You neednít stop there however; if you scroll down through the conf file just a little more, youíll see a section covering "internationalized error messages" which work on a system of master error pages, containing standard error messages in many different languages, repeated throughout the file:

 

At run time, when an error occurs, the error page is constructed using server-side includes to build the page from several template html files (bottom, top and spacer), and content-negotiation to grab the actual text for the error message in the preferred language.

If you go to the error page directory in the Apache program folder, which is C:\Program Files\Apache Group\Apache2\error on a default Windows installation, you can see all of the internationalized error pages, and within this folder is also the include folder containing the header, footer and spacer pages.

To switch this feature on, you need to copy everything from the Apache error directory to a directory in your sites hierarchy, then uncomment out the block of lines beginning with the Alias directory and ending with the ErrorDocument 506 directive.  Finally, the Alias directive needs to be changed so that it shows the path to the directory you have just created; you also need to update the Directory container to show the same path.  Donít forget that the Windows standard backslashes need to be changed to forward slashes before the paths will be accepted by Apache. 

When you try this, make sure that you comment out any of the ErrorDocument directives used previously.  Also, note that when this is configured correctly and works, you donít need to worry about whether or not the internationalized error messages will be shown in Internet Explorer Ė they will, even with the "show friendly error messages" preference set because the server-generated page is greater than 512 bytes.



 
 
>>> More Apache Articles          >>> More By Dan Wellman
 

blog comments powered by Disqus
escort Bursa Bursa escort Antalya eskort
   

APACHE ARTICLES

- Apache Unveils Cassandra 1.2
- Apache on ARM Chips? Dell and Calxeda Help M...
- The Down Side of Open Source Software
- VMware Unveils Serengeti for Apache Hadoop
- SAP Takes Steps to Improve Hadoop Integration
- Looking to Hone Apache Hadoop Skills?
- How to Install Joomla on WAMPP
- Working with XAMPP and Wordpress
- GUI Available for Apache Camel
- Reduce Server Load for Apache and PHP Websit...
- Creating a VAMP (Vista, Apache, MySQL, PHP) ...
- Putting Apache in Jail
- Containing Intrusions in Apache
- Server Limits for Apache Security
- Setting Permissions in Apache

Developer Shed Affiliates

 


Dev Shed Tutorial Topics: