Jump to content



Latest News: (loading..)

* * * * * 1 votes

Where need header response 404 or redirects?

404 header response redirect

  • Please log in to reply
7 replies to this topic

#1   Gergely

Gergely
  • Community Team
  • 528 posts
  • Real Name:Gergely Tóth
  • Gender:Male

Posted 06 April 2013 - 10:48 AM

Hi,

I would like to collect here 404 page error handling points. There are behaviour and core problems. The core problems exist now, the behaviour problems occurs after catalog actions (move, hide, delete).
  • For all pages where need to log in before (products_reviews_write.php)
  • Look at github commit acidvertigo 5baaf67d3b60c4f9e44278e9a6ee5da7d26efbdd (split page results)
  • Moved catagories or products would be usefull a redirection addon (hidden categories)
  • Non-exist (invalid) parameters (example: uninstall language collection or non exist currency)
    filter_id
    sort
    page
    currency
    action
    language

    and so on
https://support.google.com/webmasters/bin/answer.py?hl=en&answer=2409443

We should do a page handling class or function library later. Probably header tag module handling process would be usefull. In parameter handling could use an error flag and finaly redirect the page if error flag exist.

Example but not figured out:
// error_flag is global
$error_flag = array();
if ($parameter == false) {
$error_flag = array(head => '404',
		   info => 'blabla'
		   page=>''
		   );
}

if (sizeof( $error_flag)>0) {
//do header action
//redirect and so on
}

Previous error reports:
http://forums.oscommerce.com/tracker/issue-444-non-existing-links-containing-indexphp-do-not-return-404-file-not-found/


Thanks for more advices
Gergely

Edited by Gergely, 06 April 2013 - 10:49 AM.

Header Footer Content Modules
SCM
v3

and some rewrites :-)

#2   acidvertigo

acidvertigo
  • Members
  • 167 posts
  • Real Name:Luca
  • Gender:Male
  • Location:Roma

Posted 16 April 2013 - 09:26 AM

With canonical tags taken from KISS meta tag contrib, USU5 pro contrib and some code from github i have reduced signficantly this behaviour.

My ranking in google has not changed so much, but i feel more quiet and saved a lot of server resource.

I think that is a "MUST" for next versions of oscommerce to return at least a 404 for non existant pages.

#3   MrPhil

MrPhil
  • Members
  • 4,117 posts
  • Real Name:Phil
  • Gender:Male

Posted 17 April 2013 - 05:43 PM

I can see site owners wanting it one way or the other when a non-existent resource is requested (such as a page), so it should probably be configurable. If someone has an old bookmark to a now-gone product (or a search engine entry), I could see the store owner wanting to return a 404 so as not to get dinged for duplicate content on a common page, or they might want to avoid showing a 404 page to a customer, and handle it by going to the shop's main page.

Do we have agreement on what would fall into this category? A bookmark to a product would be one thing, but an invalid action that a search engine or customer has no business using could be treated differently. A missing product might go to a search that would suggest an alternative product (with a 301), rather than dead-ending with a 404 or common "Hey, stupid!" page. Moved categories or products might have hard coded lists of where to go (301 redirection). For pages that require log-in, or a specific admin user, you could redirect to a log-in page, with a return to the original requested page once there is a log-in.

#4   psicompany

psicompany
  • Members
  • 2 posts
  • Real Name:Peter Ollodart
  • Gender:Male
  • Location:Seattle WA

Posted 23 April 2013 - 06:25 PM

Hi - I wanted to ask about this. I guess from reading this post, OScommerce will not return a 404 for not found. It responds with 200OK.

Example:

http://www.psicompany.com/servlet/-strse-Marine-Electronics/searchpath/3396694/start/201/total/1000/Categories

will redirect to:

http://www.psicompany.com/not-found/

I was worried about this because Google picks this up as soft 404s. I don't know if there are any ranking issues with it, but they seem to be very adamnant that they don't like that behavior. They said this behavior is  - "A giraffe (404) with a sign on it that says "dog" (200 ok)." It's still a giraffe.

Peter

#5   kymation

kymation

    Believers

  • Community Sponsor
  • 6,682 posts
  • Real Name:Jim Keebaugh
  • Gender:Male
  • Location:Aberdeen WA USA

Posted 23 April 2013 - 08:45 PM

Google is right -- that page should return a 404. Add this code to the top of the page:

header("HTTP/1.0 404 Not Found");

You have more problems that are more important. For example, your pages have two title tags, one of which is

<title>STS Template - Reworked</title>

I think Google will penalize you more for bugs like that than they will for a broken 404.

Regards
Jim
My Addons

Banners Box 2.3.x  Support
Categories Accordion Box 2.3.x  Support
Categories Images Box 2.2x  2.3.x  Support
Closest Shipper 2.2x  Support
Document Manager 2.2x  Support
Generic Box 2.3.x  Support
Get 1 Free 2.2x  Support
jQuery Banner Rotator 2.2x  2.3.x  Support
Modular Front Page 2.3.x  Support
Modular SEO Header Tags 2.3.x  Support
MVS 2.2x  Support
PDF Datasheet 2.3.x  Support
Price Updater 2.2x
Products Specifications 2.2x  2.3.x  Development Version  Support  Bugs/Suggestions
Request a Review 2.2x - 2.3.x  Support
Similar Products Box 2.2x
Specials Image Overlay 2.3x Support
Theme Switcher 2.3.x  Support

#6   psicompany

psicompany
  • Members
  • 2 posts
  • Real Name:Peter Ollodart
  • Gender:Male
  • Location:Seattle WA

Posted 01 May 2013 - 10:12 PM

Thanks, that's an artifact from the old site - the second title tag. Has not seemed to have any issues, but I'll get rid of it. Thanks for the response.

#7   MrPhil

MrPhil
  • Members
  • 4,117 posts
  • Real Name:Phil
  • Gender:Male

Posted 02 May 2013 - 12:00 AM

View Postpsicompany, on 23 April 2013 - 06:25 PM, said:

They said this behavior is  - "A giraffe (404) with a sign on it that says "dog" (200 ok)." It's still a giraffe.

Hmm. So the ferret I bought in Argentina with a sign on it that said "French Poodle" is still a ferret? Bummer.

(ref for those not in on the "joke": https://www.google.com/search?q=ferret+poodle&ie=utf-8&oe=utf-8&aq=t&rls=org.mozilla:en-US:official)

#8   Gergely

Gergely
  • Community Team
  • 528 posts
  • Real Name:Gergely Tóth
  • Gender:Male

Posted Yesterday, 04:54 PM

@acidvertigo

Yes your work is helpfull.

@MrPhil
The 301 page handling would be appreciated if shop owners can use it as general admin function. I work with 7-8 thousands  products where 5-6 hundreds finalised or renewed by annual.

The header request answer not need definitely to say "Hey stupid, error page!" because works silent in background. The simple users not see differents even if a little note need displaying ("redirected here").

The main problem is how sending header before the html contents.
Header Footer Content Modules
SCM
v3

and some rewrites :-)