in reply to OT- Web Error Message Haiku
and of course /perl is Apache::Registry marked. And at 404-handler I have:ErrorDocument 404 /perl/404-handler
#!/usr/bin/perl -w use strict; print STDERR join (" ", map "[$_]", scalar localtime, "404 ERROR PERL", map { $ENV{$_} || "-" } qw(REDIRECT_URL REMOTE_HOST HTTP_REFERER)), "\n"; my $red_url = $ENV{REDIRECT_URL} || "?unknown?"; { local $ENV{HOME} = "/home/merlyn/lib/Stonehenge"; require Coy; } my $haiku = Coy::with_haiku("URL $red_url not found"); for ($haiku) { s/&/&/g; s/</</g; s/>/>/g; s/^\t/ /gm; s/ / /g; s/\n/<br>/g; } (my $red_html = $red_url) =~ s/[\x00-\x20"<&>"\x80-\xff]/&\#@{[ord$&]} +\;/g; my $tp_link = ""; if ($red_url =~ /^\/~/) { for ("http://www.teleport.com/$red_html") { $tp_link = <<"DQ"; <p>Perhaps you were looking for something at Teleport's web-server, such as <a href="/cgi/go/$_">$_</a>? DQ } } print <<"DQ"; Content-type: text/html Status: 404 Not Found <head><title>File Not Found</title></head> <body><h1>File Not Found</h1> <p>$haiku <p>The requested URL $red_html was not found on this server. $tp_link <p>Try looking at the <a href="/">our home page</a> as well. </body></html> DQ print " " x 512; # stupid IE
-- Randal L. Schwartz, Perl hacker
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Re: OT- Web Error Message Haiku
by Hero Zzyzzx (Curate) on Sep 27, 2001 at 22:01 UTC |