httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Ralf S. Engelschall" <>
Subject [FWD] Can you help with a ErrorDocument CGI problem?
Date Fri, 23 Oct 1998 09:53:47 GMT

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 <>
Organization: Michael Budash Consulting
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 ''.

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

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

Thanks in advance. Here's what I've got:


$|++; # autoflush stdout

$URI = substr($ENV{'REQUEST_URI'},1); # strip leading '/'

if ($URI eq 'budash') {
 print "Location:\r\n\r\n";

else {
print qq|Content-type: text/html

<TITLE>404 Not Found</TITLE>
<H1>Not Found</H1>
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 |  |
----- End forwarded message -----

                                       Ralf S. Engelschall

View raw message