Gossamer Forum
Home : Products : Gossamer Links : Discussions :

Invalid SiteHTML method

Quote Reply
Invalid SiteHTML method
Hi Andy,
when I type a wrong url on my site I get an error:
Code:
Invalid SiteHTML method: site_html_te (blabla.html). The template does not exist in 'luna'.
I think it's a mod rewrite problem!
Is there a way to show my 404 page instead?

Thanks
Matthias

Matthias
gpaed.de
Quote Reply
Re: [Matthias70] Invalid SiteHTML method In reply to
Hi,

Mmm, bit hard to test without doing some debugging

The best way to test this, is to change your stuff in .htaccess, from:

[R,L] (it may be different to that)

..to just:

[R]

This should then "redirect" you to the page.cgi URL, which should hopefully give some clues as to what URL's being called.

If you can do that, and let me know the URL that comes up, I'll do my best to find the problem Wink

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Invalid SiteHTML method In reply to
I've sent you an email with the .htaccess file
Thanks

Matthias
gpaed.de
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
Quote Reply
Re: [brewt] Invalid SiteHTML method In reply to
Hi Adrian,
thanks for your patch, but I choosed Andy redirect solution.

Code:
What do you want it to actually do when the template doesn't exist? The
easiest way to handle it, is just to do this in error.html:

<%if error contains "Invalid SiteHTML method"%>
... do a javascript redirect to the homepage
<%else%>
...show error message normally
<%endif%>

You could also edit Page.pm, but that would obviously break with any updates

Cheers

Andy

Matthias
gpaed.de
Quote Reply
Re: [Matthias70] Invalid SiteHTML method In reply to
You'll want both so that Search engines and other bots know that the URL is invalid.

Adrian
Quote Reply
Re: [brewt] Invalid SiteHTML method In reply to
brewt wrote:
You'll want both so that Search engines and other bots know that the URL is invalid.

Do you want to say Andys Solution does not work with search engines?

Matthias
gpaed.de
Quote Reply
Re: [Matthias70] Invalid SiteHTML method In reply to
He's just saying that if the page they go to should be a 404 (i.e the page doesn't exist), its best to also send a 404 status in the header, so google knows its still a 404 error (so you don't get "duplicate content" errors Smile)

Cheers

Andy (mod)
andy@ultranerds.co.uk
Want to give me something back for my help? Please see my Amazon Wish List
GLinks ULTRA Package | GLinks ULTRA Package PRO
Links SQL Plugins | Website Design and SEO | UltraNerds | ULTRAGLobals Plugin | Pre-Made Template Sets | FREE GLinks Plugins!
Quote Reply
Re: [Andy] Invalid SiteHTML method In reply to
Hi Andy,
I think I understand now. So how can I send an 404 status in the header of my error page.
In the past I just changed the redirect in the .htaccess file, when I tried to delete some pages in google...

Thanks

Matthias
gpaed.de