Posted on: 09/28/10 03:59am
By: 1000ideen
I just noticed that the current GL-version doesn`t have normal 404-pages anymore. It delivers content if a page cannot befound. Thus several pages are not being delisted in Google.
What can I do?
~~~
it concerns static pages and stories
Re: How to produce normal 404-pages again?
Posted on: 09/28/10 12:11pm
By: Laugh
I have a similar issue except I needed to change the id of a staticpage and needed a 301 redirect with the old id. I couldn't get the redirect to function properly on IIS so I hacked the staticpage plugin. I hate hacking plugins as it can make upgrades a pain but here is what I did around line 84 fo the file \public_html\staticpages\index.php
Text Formatted Code
// Hack:
if (strtolower($page) == 'old-page-name') {
Header( "HTTP/1.1 301 Moved Permanently" );
Header( "Location: http://www.mysite.com/staticpages/index.php?page=new-page-name" );
exit;
}
// ***
Re: How to produce normal 404-pages again?
Posted on: 09/28/10 05:00pm
By: 1000ideen
Wouldn`t normal 404-pages be a matter of GL rather than the plugin? I just tested a few plugins an they all display some sort of text rather than a 404. Couldn`t one hack GL a little?
Re: How to produce normal 404-pages again?
Posted on: 09/29/10 01:03pm
By: Laugh
For stories sure, you would just have to make sure that the reason the story is not available to the user is not a security privilege problem.
For 404 errors with other plugins Geeklog could handle the page but it would have to check with the plugin if the item exists or not.
With my 301 problem Geeklog would need the extra piece of info of which page it should redirect too depending on the page requested. For this reason I was thinking of creating a small plugin for it or adding it to one of the other admin plugins out there.
Tom
Re: How to produce normal 404-pages again?
Posted on: 09/29/10 06:22pm
By: 1000ideen
I made this 404 a feature request: http://project.geeklog.net/tracking/view.php?id=1199 I don`t know with the 301 it i a separate thing but certainly also a good idea.
Re: How to produce normal 404-pages again?
Posted on: 10/02/10 11:13am
By: Laugh
Stupid me. I had checked this before I hacked the staticpages plugin but I missed the blank page format options.
Anyways for staticpages set the Page Format to Blank page. You then enable Execute Php and then put
Text Formatted Code
header('HTTP/1.0 404 Not Found');
For your 404 file not found error
For a 301 redirect you would put
Text Formatted Code
header( "HTTP/1.1 301 Moved Permanently" );
header( "Location: http://www.mysite.com/staticpages/index.php?page=my-new-page" );
Re: How to produce normal 404-pages again?
Posted on: 10/02/10 06:24pm
By: 1000ideen
So do I need your above hack then? Or just that one line?
header('HTTP/1.0 404 Not Found'
; BTW, this alone dos not work.
Re: How to produce normal 404-pages again?
Posted on: 10/03/10 09:53am
By: Laugh
You do not need the hack. I just tried the 404 error code and it worked fine (the browser returned a page not found message instead of Geeklog)
Lets review what you need to do.
1. Create a new staticpage
2. Fill in the following Fields:
Title: 404 Not Found
Page Format: Blank Page
ID: the id of the staticpage you want not found.
Content: header('HTTP/1.0 404 Not Found'
;
PHP: execute PHP
3. Save the Page
Re: How to produce normal 404-pages again?
Posted on: 10/03/10 06:31pm
By: 1000ideen
O.k., I`m trying that and I only receive a blank page without a title. The URL is the page that is not to turn up but to produce a 404.
php is enabled with static pages.
Re: How to produce normal 404-pages again?
Posted on: 10/03/10 11:27pm
By: Laugh
That is probably working then. Google Search Bot would look at the header and see a 404 error.
You can check for sure by entering your url here
http://www.seoconsultants.com/tools/headers[*1]
It you want a 404 message that a visitor can read you would have to add in some html.
Tom