in reply to How to send a "true" 404 error via Perl
Works for me with Apache.
test.cgi:
#!/usr/bin/perl print "Status: 404 Not Found\n"; print "\n";
access log:
xx.xx.xx.xx - - [17/Jan/2007:17:56:39 -0500] "GET /test.cgi HTTP/1.1" +404 - "-" "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8.1.1 +) Gecko/20061204 Firefox/2.0.0.1" www.example.com
I can even return an HTML message.
test.cgi:
#!/usr/bin/perl print "Status: 404 Not Found\n"; print "Content-Type: text/html\n"; print "\n"; print "<title>404 Not Found</title>\n"; print "<h1>404 Not Found</h1>\n";
access log:
xx.xx.xx.xx - - [17/Jan/2007:18:00:15 -0500] "GET /test.cgi HTTP/1.1" +404 52 "-" "Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:1.8.1. +1) Gecko/20061204 Firefox/2.0.0.1" www.example.com
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How to send a "true" 404 error via Perl
by lokiloki (Beadle) on Jan 17, 2007 at 23:04 UTC | |
by ikegami (Patriarch) on Jan 17, 2007 at 23:09 UTC | |
by lokiloki (Beadle) on Jan 17, 2007 at 23:13 UTC | |
by ikegami (Patriarch) on Jan 17, 2007 at 23:14 UTC | |
by lokiloki (Beadle) on Jan 17, 2007 at 23:20 UTC | |
|