Return-Path: Delivered-To: new-httpd-archive@hyperreal.org Received: (qmail 4378 invoked by uid 6000); 23 Oct 1998 10:06:06 -0000 Received: (qmail 4354 invoked from network); 23 Oct 1998 10:05:56 -0000 Received: from slarti.muc.de (193.174.4.10) by taz.hyperreal.org with SMTP; 23 Oct 1998 10:05:56 -0000 Received: (qmail 10494 invoked by uid 66); 23 Oct 1998 10:05:55 -0000 Received: by en1.engelschall.com (Sendmail 8.9.1) for new-httpd@apache.org id LAA05978; Fri, 23 Oct 1998 11:53:48 +0200 (CEST) Message-ID: <19981023115347.A5718@engelschall.com> Date: Fri, 23 Oct 1998 11:53:47 +0200 From: "Ralf S. Engelschall" To: Apache Group Developer ML Subject: [FWD] Can you help with a ErrorDocument CGI problem? Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.93.2i Organization: Engelschall, Germany. X-Web-Homepage: http://www.engelschall.com/ X-PGP-Public-Key: http://www.engelschall.com/ho/rse/pgprse.asc X-PGP-Fingerprint: 00 C9 21 8E D1 AB 70 37 DD 67 A2 3A 0A 6F 8D A5 Sender: new-httpd-owner@apache.org Precedence: bulk Reply-To: new-httpd@apache.org Not acked. I'm totally busy with other stuff and perhaps someone other has a few hints for him. ----- Forwarded message from Michael Budash ----- Date: Fri, 23 Oct 1998 02:43:58 -0700 From: Michael Budash Reply-To: mbudash@sonic.net Organization: Michael Budash Consulting To: rse@engelschall.com Subject: Can you help with a ErrorDocument CGI problem? Sir - I know you're a busy guy, so if you can't help here, just say so... I'm trying to write a perl ErrorDocument CGI for the 404 error message. Eventually I want it to redirect to a url looked up in a table keyed by the value of the REQUEST_URI environment variable (if not found in the table, show a standard-looking 404 page). For now I'm leaving the table lookup out of it, and simply testing with 'http://domain.com/budash'. It does run, but it won't redirect using a Location: header. It instead tries to download a file called 'budash' of type 'application/x-httpd-cgi' or something like that! I've tried some variations using non-parsed-headers, and it's no-go there either. I'd appreciate any feedback at all as to what I might be doing wrong. I've already been to the Apache site, but didn't really see anything I could use. Thanks in advance. Here's what I've got: #!/usr/bin/perl5 $|++; # autoflush stdout $URI = substr($ENV{'REQUEST_URI'},1); # strip leading '/' if ($URI eq 'budash') { print "Location: http://www.sonic.net/~mbudash\r\n\r\n"; } else { print qq|Content-type: text/html 404 Not Found

Not Found

The requested URL $ENV{'SERVER_NAME'}$ENV{'REQUEST_URI'} was not found on this server. |; } -- @-----------------------------@--------------------@ | Michael Budash Consulting | 707-255-5371 | | Perl, Javascript, Html | 707-258-7800 x7736 | | Official Extropia Developer | mbudash@sonic.net | @-----------------------------@--------------------@ ----- End forwarded message ----- Ralf S. Engelschall rse@engelschall.com www.engelschall.com