in reply to Catching Apache error with a Perl script
Apache ErrorDocument directive issues an internal redirection filling your %ENV with special fields identified by REDIRECT_ prefix containing useful informations. Besides that, you can use the usual CGI methods inside your script to retrieve passed parameters. Here is a little snippet that will show the values available to your "error handler":
#!/usr/bin/perl use CGI; use Data::Dumper; my $q = CGI->new; %v = $q->Vars; print $q->header; print "<pre>\n"; print Dumper(\%v), "\n"; print Dumper(\%ENV), "\n"; print "</pre>";
Please note that you don't need to pass the original error code (ie 404, etc), because that code is already available via REDIRECT_STATUS.
Ciao, Valerio
|
|---|