Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Where need header response 404 or redirects?


tgely

Recommended Posts

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://www.oscommerce.com/forums/tracker/issue-444-non-existing-links-containing-indexphp-do-not-return-404-file-not-found/

 

 

Thanks for more advices

Gergely

:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

Link to comment
Share on other sites

  • 2 weeks later...

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.

Link to comment
Share on other sites

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.

Link to comment
Share on other sites

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

Link to comment
Share on other sites

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

See my profile for a list of my addons and ways to get support.

Link to comment
Share on other sites

  • 2 weeks later...

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.

Link to comment
Share on other sites

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)

Link to comment
Share on other sites

  • 3 weeks later...

@@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.

:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

Link to comment
Share on other sites

  • 8 months later...

just working on new redirection project. I am discovering a lot of construction problem which are referal to server speed and very large amount of bad links. The module is beta testing now but ASAP I will be supported to community.

:blink:
osCommerce based shop owner with minimal design and focused on background works. When the less is more.
Email managment with tracking pixel, package managment for shipping, stock management, warehouse managment with bar code reader, parcel shops management on 3000 pickup points without local store.

Link to comment
Share on other sites

just working on new redirection project. I am discovering a lot of construction problem which are referal to server speed and very large amount of bad links. The module is beta testing now but ASAP I will be supported to community.

 

If you need some testing let me know. Thanks for working on this.

I am not a professional webmaster or PHP coder by background or training but I will try to help as best I can.

I remember what it was like when I first started with osC. It can be overwhelming.

However, I strongly recommend considering hiring a professional for extensive site modifications, site cleaning, etc.

There are several good pros here on osCommerce. Look around, you'll figure out who they are.

Link to comment
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...