http://www.perlmonks.org?node_id=86092


in reply to Smart Forwarding Script upon 404

You might want to check out www.aplawrence.com/Unix/custom404.html

I found it while looking for a solution to a similar problem of my own. I just took over maintainance of a web site which was previously done by several different people (all in their own areas). Needless to say, the site is a mess, so my first task is to clean it up and reorganize it.

Since I'll need to move a lot of files around, I didn't want to set up a ton of individual links for each page I move. So, I started working on a script (run on every 404 error) that would search through a text file, listing the pages that have been moved. This way, I can just keep this one file up to date.

While working on this, I found had some ideas to extend this to random 404s. I wanted the program to be able to correct any mispelled urls and give a list of possible matches (if the page was not found in the moved file).

I'm still working on the script (with much help from the page above). But I should be done with it by the end of this week. When I get it finished, I'll put up another post (since I want to have everyone look through it and comment on it anyway).