URL Mapping - ApacheCon 2005
CGI 404 handler
  • Then /cgi-bin/404.cgi will look like:

    
     #!/usr/bin/perl
     use Mail::Sendmail;
     use strict;
    
      
    
     my $message = qq~
     Document not found: $ENV{REQUEST_URI}
     Link was from: $ENV{HTTP_REFERER}
     ~;
    
      
    
     my %mail = (
    	To => '[email protected]',
    	From => '[email protected]',
    	Subject => 'Broken link',
    	Message => $message,
    	);
     sendmail(%mail);
    
      
    
     print "Content-type: text/html\n\n";
     print "Document not found. Admin has been notified";
    
      

Index
Back to Example of a 404 CGI handler.
Forward to Error documents in Apache 2.0

ApacheCon 2005 : URL Mapping - Slide #28 of 45