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

+1


source to share


2 answers


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

+3


source


Sounds like you want more, but have you looked at Apache mod_speling



+2


source







All Articles