From 47daba8d5fd8757e5d9eb6c3595e20fdfa57bfdf Mon Sep 17 00:00:00 2001 From: Alex Schroeder Date: Fri, 4 Jun 2004 00:45:27 +0000 Subject: [PATCH] *** empty log message *** --- 404handler.pl | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) create mode 100755 404handler.pl diff --git a/404handler.pl b/404handler.pl new file mode 100755 index 00000000..ab0d8ea3 --- /dev/null +++ b/404handler.pl @@ -0,0 +1,20 @@ +#! /usr/bin/perl +package OddMuse; +my $dir = '/var/www/wiki'; +my $script = '/usr/lib/cgi-bin/wiki.pl'; +my @path = split(/\//, $ENV{REDIRECT_URL}); +my $file = $path[$#path]; + +# remember to compare modification dates on the pageidx file! +# remember to set $ScriptName in the config correctly. +# call $script as "true CGI" so that we can look at http status codes! + +{ + local $/; + open(F, "$script |") || print STDERR "can't run $script: $!\n"; + my $data = ; + print $data; + open(G, "> $dir/$file") || print STDERR "can't write $dir/$file: $!\n"; + print G $data; +} +