Advanced

Build 404 error page CGI handler brains

Posted by solrac on · 1 comment
IBM/developerWorks; By Nathan Harrington
Mail this story
Print this story

Bad URLs, every Web site's bane, generate the infamous 404 error. Make your 404s useful by customizing redirects based on your site's content. This article shows you how to create your own 404 error-message intelligent CGI handler to provide useful links and 404 error page redirects for the contents of your site.

Bad URLs, every Web site's bane, generate the infamous 404 error. Make your 404s useful by customizing redirects based on your site's content. This article shows you how to create your own 404 error-message intelligent CGI handler to provide useful links and 404 error page redirects for the contents of your site.

Full Story

  Nav
» Read more about: Story Type: News Story, Tutorial; Groups: Community

» Get new stories by e-mail: nightly or as they are published

« Return to the newswire homepage

  Related stories
» More like this

Comments (1)

When I ran a home webserver, I got hundreds or thousands of Nimda and Code Red worms knocking on my system, hoping it was running a default Microsoft IIS server. I wanted to clean up my logs, and stop the infected systems from doing anything with my own system. I set up a SUID ipchains in its own directory under /opt, then hacked a 404 script in Perl to check the request for signs of Nimda or Code Red. If it looked like one of these, it invoked the ipchains to immediately "-j DROP" all packets coming from the offending address.

Within a day, my Apache logs were much saner. When the list got up to 50 entries or so, I flushed it out and started fresh.

Caveat: If you take this approach, then run a vulnerability scanner such as Sussen from localhost, you *will* block yourself from your own system! (Hard-won experience talking here.) You could schedule an "at" job ten or twenty minutes out to flush the network blocks caused by the scan, and then all should be OK again.

Post a comment

A free account is needed to post. Write your comment here first: your text is kept in this browser while you sign up or log in, and is waiting for you when you come back.

Your message:
|||||
10
Markdown: **bold**, *italic*, [text](https://link), - lists, > quotes, $x^2$ for math. Formatting help

Sign up and post (it is free)  or  Log in and post