I'm trying to create an intelligent 404 manager, and while it is 80% complete, it is just missing the 'intelligent' part now. What I want to do is look at the non-existant URL that was asked for, and search for specific words within that string. Take this for example:
http://www.mycompany.com/order.php2
Isolate the 'order.php2' part, search it for keywords, say 'order' 'support' 'help' and mis-spelt variations of the above, and then create a 404 page that suggests the correct URL. so for ...com/order.php2 PHP would see 'order' and automagically create a link to ..com/order.php3. If it found 'oredr' instead of 'order', again it would create the correct link. The list of keywords/mis-spellings would be human-maintained.
I've tried a few different methods to achieve this, but I'm stumped. Can someone offer some suggestions or code samples?
Many thanks.