Home Page

A Smarter 404 page not found solution using ASP!

This is great way to retain users when they follow dead links or to help search engines find pages that have change URLS. This script will attempt to find pages that are either the exact match or close to what the user was looking for when they encountered the page not found. The script uses a "difference distant" type algo to compute how close a page is to what the user type in or followed in a hyper link.

Copy and paste the code below making the needed changes to:

strFilesTypesToSearch - What file extensions you want this script to look at.
strBarredFolders -What folders are off limits, not to be included in the results
strBarredFiles - What files are off limits, not to be included in the results

Save the file as 404.asp in the root of your web.

You have 3 options to make this script run when the 404 error is detected.
  1. Now you can either set your 404 error page via your hosts control panel if you have access to it.
  2. Request the host to make this page your 404 error page
  3. Make the changes IIS f you have access:

Note, if you get a permission denied error then one of your folders is set to not allow access, just add it to the strBarredFolders variable at the top of this script.