You meant...? How to guess what a user wants to enter (on a 404 page)
I am setting up a 404 page for my site. I'd like him to include "Did you mean ...?" I need to figure out how to do this.
Here's what I have been doing so far: I come up with a wide list of files that the user can search for, and then use levenshtein () to compare every possible filename against the dark filename. Those with the lowest differences are selected for "Did you mean".
I've also considered using metaphone (), but I think it might be overkill.
What would you suggest for "Did you mean ...?" script
source to share
One thing you might want to consider is the Google 404 script for what you mentioned. It probably won't be as good as a custom solution, but it might be worth trying to be sure.
http://googlewebmastercentral.blogspot.com/2008/08/make-your-404-pages-more-useful.html
source to share