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).


In reply to Re: Smart Forwarding Script upon 404 by Anonymous Monk
in thread Smart Forwarding Script upon 404 by zane

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.