Document Not Found
By Randal L. Schwartz
My site, www.stonehenge.com, just got a shiny new virtual Web server. Previously, it was hosted at and aliased to www.teleport.com. Thus, to get to my specific stuff, you had to point your browser to www.stonehenge.com/~merlyn, which was the same as www.teleport.com/ ~merlyn. Unfortunately, www.stonehenge.com/~madamex was also the same as www.teleport.com/~madamex madamex's Web pages at Teleport. But now I can control everything that appears at www.stonehenge.com, and www.stonehenge.com/ ~madamex is just another (missing) directory.
I didn't think moving the www.stonehenge.com address would be a very big deal, but I hadn't counted on the number of people who had been accessing www.teleport.com as www.stonehenge.com, or on the number of references in hot lists. Worse yet, the Lycos search engine apparently decided that all 16,000 Web pages at Teleport belonged under www.stonehenge.com. Ugh!
So, from the first hour it was set up, my shiny new virtual Web server was getting bad hits. For example, someone would try to follow a link for www.stonehenge.com/~tangent/scb.html, and get back nothing but the standard error text. I decided to help them out a bit.
The Apache Web server allows me to create a CGI script to handle particular types of errors. In this case, the error was type "404" (document not found). By placing the directive:
ErrorDocument 404
/cgi/404-handler
into a configuration (.h