|
When someone comes to a 404 document, especially the unfriendly Apache version, they might give up trying to visit you. Therefore it is paramount that you have some measures at hand.
That's up 10% since 1998. Or 5% every year, which, if it holds true still, means 33% of all web pages today have one or more broken links. 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. You can send other error codes as well, 401 "Authorization required", for example, look up more information about HTTP error codes, client errors and server errors. A 401 should never be redirected because the client will not know that it should present the user with an authorization box. I suggest you create a php file (or perl file) which will handle your 404 errors. That script should incorporate the same look and feel of your site, but it should also inform the user about the problem and present the user with solutions, which is what I will concentrate on. Comment List
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||