dcsimg
 

Zez.org: How to make 404 messages friendlier with Apache

by ServerWatch Staff

The first thing you should do is configure Apache to serve a customized 404 document. This is done either in the server configuration, the virtual host, PR directory or in the .htaccess file.

[ Thanks to Paul K Egell-Johnsen for this link. ]

"The first thing you should do is configure Apache to serve a customized 404 document. This is done either in the server configuration, the virtual host, PR directory or in the .htaccess file. What you need to do is add the following directive into the selected configuration:"

"ErrorDocument 404 URL"

"The URL can be "http://somehost.somewhere.com/", "/path/to/document.html", "/path/to/script.php" or "Plain text". You should use a path, since the error code will be propagated to the client, whomever that might be. If you use an URL a redirect will be sent, and that isn't the message you would like to send people."

This article was originally published on Tuesday Nov 21st 2000
Home
Mobile Site | Full Site