Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Re: [Matthias70] Invalid SiteHTML method

Quote Reply
Re: [Matthias70] Invalid SiteHTML method In reply to
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
Subject Author Views Date
Thread Invalid SiteHTML method Matthias70 6379 Feb 2, 2011, 7:59 AM
Thread Re: [Matthias70] Invalid SiteHTML method
Andy 6247 Feb 2, 2011, 8:45 AM
Post Re: [Andy] Invalid SiteHTML method
Matthias70 6235 Feb 2, 2011, 10:45 AM
Thread Re: [Matthias70] Invalid SiteHTML method
brewt 6200 Feb 2, 2011, 12:33 PM
Thread Re: [brewt] Invalid SiteHTML method
Matthias70 6193 Feb 2, 2011, 2:35 PM
Thread Re: [Matthias70] Invalid SiteHTML method
brewt 6202 Feb 3, 2011, 1:39 AM
Thread Re: [brewt] Invalid SiteHTML method
Matthias70 6164 Feb 3, 2011, 8:11 AM
Thread Re: [Matthias70] Invalid SiteHTML method
Andy 6154 Feb 3, 2011, 8:36 AM
Post Re: [Andy] Invalid SiteHTML method
Matthias70 6147 Feb 3, 2011, 12:48 PM