Your rewrite rule is redirecting everything to page.cgi, including invalid urls. Sometimes you just can't do anything about that.
Here's a patch to Page.pm to return a proper 404 header (though it will still show that error page):
Code:
--- Page.pm 2006/08/23 22:21:52 1.27
+++ Page.pm 2007/02/13 19:44:20 1.28
@@ -3,7 +3,7 @@
#
# Website : http://gossamer-threads.com/
# Support : http://gossamer-threads.com/scripts/support/
-# Revision : $Id: Page.pm,v 1.27 2006/08/23 22:21:52 brewt Exp $
+# Revision : $Id: Page.pm,v 1.28 2007/02/13 19:44:20 brewt Exp $
#
# Copyright (c) 2001
Gossamer Threads Inc. All Rights Reserved.
# Redistribution in part or in whole strictly prohibited. Please
@@ -146,9 +146,7 @@
print Links::Build::build('category', \%opts);
}
else {
- if ($CFG->{dynamic_404_status}) {
- print "Status: 404" . $GT::CGI::EOL;
- }
+ print "Status: 404" . $GT::CGI::EOL if $CFG->{dynamic_404_status};
print $IN->header();
print Links::SiteHTML::display('error', { error => Links::language('PAGE_INVALIDCAT', $page) });
}
@@ -219,6 +217,7 @@
$page = $IN->param('g') || $ENV{PATH_INFO} || '';
($id) = $page =~ /(\d+)\Q$CFG->{build_extension}\E$/;
if (!$id) {
+ print "Status: 404" . $GT::CGI::EOL if $CFG->{dynamic_404_status};
print $IN->header();
print Links::SiteHTML::display('error', { error => Links::language('PAGE_INVALIDDETAIL', $page) });
return;
@@ -239,6 +238,7 @@
}
if (!$link) {
+ print "Status: 404" . $GT::CGI::EOL if $CFG->{dynamic_404_status};
print $IN->header();
print Links::SiteHTML::display('error', { error => Links::language('PAGE_INVALIDDETAIL', $page) });
return;
Adrian