[Xitami] Additional error handling issue

Russel Olinger rolinger1 at hotmail.com
Wed Feb 20 08:44:46 CET 2008


I wrote a perl header to handle 404 errors for pages that no longer exist.

use CGI qw/header/ ;

print header(-expires=>'now',
    -status=>'404 Not Found',
    -type=>'text/html'); 
print qq{ $rest_of_html } ;

Using a page like http://web-sniffer.net, the HTTP Response Header comes back as a valid 404 Not Found page, however my web log shows the GET as status code 200.

In access.log
76.173.7.200 - - [19/Feb/2008:23:03:09 -0800] "GET /pshow/lax/3/26/0/19307/ HTTP/1.1" 200 437 "" ""

FYI: /pshow is aliased to /cgi-bin/postShow.pl - which is a successful script call.

In errors.log : nothing listed.

The 200 at the end of that access.log line is the status code, the 437 is the file size of the returned HTML.  But why am I getting a 200 and no recording of a 404 when in fact other Header Response analysis sites do show the page returning a valid 404? 

Is it because the server is successfully calling the script so it logs a 200, but then the script fails the ID lookup, and returns a 404?  If this is the case, how do I get my access.log file or errors.log file to log the 404 error?

Any insight would greatly help.
Thanks
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.xitami.org/pipermail/xitami/attachments/20080219/d44c8433/attachment.htm 


More information about the Xitami mailing list