Please login or register.

Login with username, password and session length
Advanced search  

News:

You need/want an older version of sNews ? Download an older/unsupported version here.

Pages: [1] 2

Author Topic: Does someone use Google 404 into sNews?  (Read 7477 times)

Sven

  • ULTIMATE member
  • ******
  • Karma: 88
  • Posts: 2029
  • Chasing MY bugs!
    • hiseo.fr - rédacteur Web
Does someone use Google 404 into sNews?
« on: September 04, 2008, 10:26:42 AM »

It might be a good idea to use it since Google 404 suggest from its index the page on your website where the keyword can be found automatically.
More, if you the visitor asked for an old URL which has been renamed, Google 404 suggest the new URL.
Good!
Problem: go to my web site with such a page URL.:
-http://www.hiseo.fr/contenu/la-redaction-de-pages-web/
it returns a 404
but for some reasons I don't get, sNews block the Google 404 script which should suggest the right URL:
-http://www.hiseo.fr/contenus/la-redaction-de-pages-web/
and Google would have suggest too in the search box to find the page with these keywords "la redaction de pages web"

But it suggest to search for 404. ;D

So, if someone use it within sNews how did he fix it?

Joost

  • Guest
Re: Does someone use Google 404 into sNews?
« Reply #1 on: September 04, 2008, 11:13:21 AM »

Morning Philippe,

It is a bug in sNews1.6. I've suggested a bug-fix more than a year ago. However, this fix is banned to section programming.
The ban suggests that the code is not ready for production environments, but I can assure, it is rock solid.
Logged

Sven

  • ULTIMATE member
  • ******
  • Karma: 88
  • Posts: 2029
  • Chasing MY bugs!
    • hiseo.fr - rédacteur Web
Re: Does someone use Google 404 into sNews?
« Reply #2 on: September 04, 2008, 12:10:59 PM »

oh... oh... didn't see that.
Gonna try it within the hour.
Merci Monsieur Joost.

Sven

  • ULTIMATE member
  • ******
  • Karma: 88
  • Posts: 2029
  • Chasing MY bugs!
    • hiseo.fr - rédacteur Web
Re: Does someone use Google 404 into sNews?
« Reply #3 on: September 04, 2008, 12:32:49 PM »

I am in the early stage of learning php programming and understanding sNews.
That was just a year ago. ;D
The way to get rid of 302 and response with a 404 header is by replacing the following line, (aproximately 290):
Code: [Select]
header('Location: '.db('website').'404/'); exit;with:
Code: [Select]
header('HTTP/1.1 404 Not Found');
Is that code still correct? (I have a syntax error)

EDITION: no... no... It works locally no syntax error but no 404 redirection too.
2nd EDITION: removing exit removes redirection. Hmmm... my function startup is a kind of a mess. Goota see what can be clean out.
« Last Edit: September 04, 2008, 01:16:14 PM by Sven »
Logged

Joost

  • Guest
Re: Does someone use Google 404 into sNews?
« Reply #4 on: September 04, 2008, 01:29:19 PM »

I am in the early stage of learning php programming and understanding sNews.
That was just a year ago. ;D

I stopped trying to understand sNews. I simply nod now and then, just pretending...

Is that code still correct? (I have a syntax error)

The code is still correct, but not on line 290. Here, on your already heavily modded version, it shows no errors, returns a 404 header (essential for Google) but it does not show something like "Page Not found". So we need to tweak that.
I guess there is also a third party script involved? Downloadable? Anywhere? Or did you write it yourself?  ::) :-\ :-X


Logged

Sven

  • ULTIMATE member
  • ******
  • Karma: 88
  • Posts: 2029
  • Chasing MY bugs!
    • hiseo.fr - rédacteur Web
Re: Does someone use Google 404 into sNews?
« Reply #5 on: September 04, 2008, 01:43:31 PM »

The code I have is related to My Google account.
If you use the Google Webmasers Tools you just have to log into your account.
In the left panel navigation menu, there's to tools and there you will find: Improve your 404 page (it might be in dutch, beware).
Then you will have a JS piece of code, and next page you will find the CSS to customize your brand new 4004 page to fit you design.
That's a new service and I think it's a good idea to have such functionnalities.
(...) Or did you write it yourself?  ::) :-\ :-X
;D You're the best! ;)
I'm under my desk! Can't stop laughing!
« Last Edit: September 04, 2008, 01:45:22 PM by Sven »
Logged

Joost

  • Guest
Re: Does someone use Google 404 into sNews?
« Reply #6 on: September 04, 2008, 02:20:00 PM »

I assume (after a quick look): You have copy pasted the code into function error404().

If that's the case, the bugfix doesn't help, Because it doesn't trigger function error404().
The simplest method to overcome this, is a external error page and include that page (no need to edit .htaccess).
Replace:
header('Location: '.db('website').'404/'); exit;

with:
header('HTTP/1.1 404 Not Found'); include "/pathTo/Error.html"; exit;

"/pathTo/Error.html" is the location of the external error page.
I didn't have time to test this, but I've posted a mod somewhere that is similar.

I'll be gone for an hour or two. I found some of my photographs being used on a (governmental-)site without my permission. :(
These photographs are probably in print as well. I don't mind the government cutting down expenses, but... You know. ;)

Logged

Sven

  • ULTIMATE member
  • ******
  • Karma: 88
  • Posts: 2029
  • Chasing MY bugs!
    • hiseo.fr - rédacteur Web
Re: Does someone use Google 404 into sNews?
« Reply #7 on: September 04, 2008, 04:18:06 PM »

I'll be gone for an hour or two. I found some of my photographs being used on a (governmental-)site without my permission. :(
These photographs are probably in print as well. I don't mind the government cutting down expenses, but... You know. ;)
:o The Web Agency (or the webmaster) gonna have some problems.
After (-http://www.hiseo.fr/redacteur-web_erreur-404.htm) this step I'm gonna find my way in sNews to the redirection trick for the static 404 page. ;D
« Last Edit: September 15, 2008, 07:52:47 AM by Sven »
Logged

Joost

  • Guest
Re: Does someone use Google 404 into sNews?
« Reply #8 on: September 04, 2008, 04:46:02 PM »

Great!  ;D ;D
But how to translate "Doorgaand verkeer"?  ???
It seem I am promoted to administrator. I can change your posts into clever php solutions. That would be unethical of course. But would it be inappropriate to continue off topic conversation in tiny fonts? ps: don't tell anyone :-X
Logged

Sven

  • ULTIMATE member
  • ******
  • Karma: 88
  • Posts: 2029
  • Chasing MY bugs!
    • hiseo.fr - rédacteur Web
Re: Does someone use Google 404 into sNews?
« Reply #9 on: September 04, 2008, 05:00:11 PM »

Congrats Joost for your porno promo!
After this effort I've done the changes in sNews.
But how to translate "Doorgaand verkeer"?  ???
Nobody care:
The page is now a kinda of "nowhereland" where "nowheremen" sank.
No Joost, no 404, no header... the desert.
I've tried to digg off the forum the Mod you were talking about.
In which year did you write?

Joost

  • Guest
Re: Does someone use Google 404 into sNews?
« Reply #10 on: September 04, 2008, 05:07:58 PM »

Logged

Sven

  • ULTIMATE member
  • ******
  • Karma: 88
  • Posts: 2029
  • Chasing MY bugs!
    • hiseo.fr - rédacteur Web
Re: Does someone use Google 404 into sNews?
« Reply #11 on: September 04, 2008, 05:39:06 PM »

I bet you're right. Even if at that moment I wasn't interested since Google service wasn't there.
function error404 should be commented out?
and all calls to the function too as this one:
Quote
case '404': error404(); break;
I have a 404 header response but page isn't there.
« Last Edit: September 04, 2008, 05:43:27 PM by Sven »
Logged

Joost

  • Guest
Re: Does someone use Google 404 into sNews?
« Reply #12 on: September 04, 2008, 05:49:48 PM »

I've noticed. Probably the path isn't correct. It is not a path like;
http://www.hiseo.fr/redacteur-web_erreur-404.htm
It is a relative system path like ./redacteur-web_erreur-404.htm
or the full system path, somewhat similar to the one that showed earlier.
Logged

Joost

  • Guest
Re: Does someone use Google 404 into sNews?
« Reply #13 on: September 04, 2008, 06:13:06 PM »

Switching on error_report(1); might give us a clue.
Logged

Sven

  • ULTIMATE member
  • ******
  • Karma: 88
  • Posts: 2029
  • Chasing MY bugs!
    • hiseo.fr - rédacteur Web
Re: Does someone use Google 404 into sNews?
« Reply #14 on: September 04, 2008, 06:19:06 PM »

oh....
I was trying:
Quote
<?php
header('HTTP/1.1 404 Not Found');   die(include (errorpage.html));
?>
okey now: with your code above it gives something.
Pages: [1] 2