DelphiFAQ Home Search:

Getting more out of 404 traffic (Document not found error)

 

comments3 comments. Current rating: 4 stars (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.


Content-type: text/html

Comments:

2006-03-09, 07:36:08
anonymous from Venezuela  
rating
Read the httpd.conf file fo your apache server, it has a few examples of how to do this.
2015-02-01, 00:24:15
anonymous from Singapore, Singapore  
So true. Honesty and everything reodznigec.
2015-02-10, 09:41:58
anonymous from United States  
use every http://levitraus.club respectively mangosteen clearly http://viagra24h.net whole body anxiety http://viagranet.net haunting detail

 

 

NEW: Optional: Register   Login
Email address (not necessary):

Rate as
Hide my email when showing my comment.
Please notify me once a day about new comments on this topic.
Please provide a valid email address if you select this option, or post under a registered account.
 

Show city and country
Show country only
Hide my location
You can mark text as 'quoted' by putting [quote] .. [/quote] around it.
Please type in the code:

Please do not post inappropriate pictures. Inappropriate pictures include pictures of minors and nudity.
The owner of this web site reserves the right to delete such material.

photo Add a picture: