Windows Apache (6) mod_perl (3) File Types (33) Internet Explorer (6) Network (11) Passwords (6) Printing Processes (13) Programming (318)
Exchange Links About this site Links to us 
|
Getting more out of 404 traffic (Document not found error)
1 comments. Current rating: (1 votes). Leave comments and/ or rate it.
When your web site visitor clicks on a dead link, most sites just provide a standard screen 'Document not found'.
If the link was on your own site, then you should fix it.
But since there are also dead links on external sites, you should look into having a better error document.
If you have access to your web server's configuration file (typical location for Apache 2.0: /etc/httpd/conf/, then you can define your custom 404 document there. You could have it point to a perl script. The perl script could look at the requested document with $url = $ENV{REQUEST_URI} and try to make intelligent suggestions what document to view instead.
If you cannot use a server side script (perl, php, asp, jsp) as your 404 handler, then you might do some client side processing by adding javascript code.
This is inferior because it relies on the user's setting (Javascript could be disabled!) but better than nothing.
You can look at the document.location property in Javascript and offer a few intelligent suggestions or just state that a certain product/ topic has been removed from your site.
See the tip in the See-also section how to do this in Javascript.
Comments:
|
|
|
|
Read the httpd.conf file fo your apache server, it has a few examples of how to do this.
|
|