Jump to content

Recommended Posts

If you have a google webmaster account, you will probably have noticed an increase in the number of soft 404 errors. There are several causes for this but one of the main ones is that oscommerce doesn't return the proper status code when a category, manufacturer or product cannot be found. This addon changes the code so that the correct header status is returned.

Edited by Jack_mcs

Share this post


Link to post
Share on other sites

Yes Yes Yes!! I have this exact problem on my site Jack!!!


Magento Sucks - Oscommerce Rocks.

Share this post


Link to post
Share on other sites

All sites do, or have the potential for it, since oscommerce doesn't return 404 and 410 codes. Though that is only a problem if categories, manufacturers or products have been deleted or made not available.

Share this post


Link to post
Share on other sites

Hey Jack, great contribution. Exactly what I was looking for. Thank you!

Share this post


Link to post
Share on other sites

You're welcome. :)

 

Any suggestions?

 

 

/**** Begin Header Status Handler by Jack York @ ocommerce-solution.com ****/

if (HSH_ENABLE == 'true') {

if (($category_depth != 'top' || ($category_depth == 'top' && isset($_GET['manufacturers_id'])) )&& ! IsvalidCatOrMan($cPath, $_GET['manufacturers_id'], $languages_id)) {

header("HTTP/1.1 410 Gone");

header("Status: 410 Gone");

printf("<script>window.location='" . HSH_REDIRECT_TO . "'</script>");

exit;

}

}

/**** End Header Status Handler by Jack York @ ocommerce-solution.com ****/

Share this post


Link to post
Share on other sites

It means you didn't install it properly. The required file is probably missing.

Share this post


Link to post
Share on other sites

The error is saying differently. It might be that you have altered code that is causing the problem but there's no way for me to troubleshoot that in a support thread. You'll have to figure out why it can't find the included file or pay someone to troubleshoot it for you.

Share this post


Link to post
Share on other sites

Works well, one more tool to keep the Google Gods and maybe even Bing happy.

 

Thanks


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.

Share this post


Link to post
Share on other sites

Hello all,

 

I've also installed the Header Status Handler, but I'm wondering what you are using for the custom error pages then ?

Custom Server Error Pages addon is no longer working as posted in the support thread for new OSC versions.

 

Or are you not using any custom error pages ? Then I see no chance to keep the visitor on my site.

Thus I liked the idea to have custom error pages in the look and feel of the store, where people can search and view other items.

Any feedback or ideas would be very much appreciated.

 

Thanks!

Share this post


Link to post
Share on other sites

@mk_osc

 

Marcus, my host has a utility that let's me make my own custom error pages. So that's my base.

 

Then I've also added Goggles 404 error widget for those type pages.

  • It adds a search box for your site with appropriate search suggestions.
  • It tries to provide alternatives to incorrect URLs. (my site has a human friendly sitemap and this Widget found that page and included the link in the 404 custom error page.

Available in Google Webmaster Tools

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.

Share this post


Link to post
Share on other sites

Share this post


Link to post
Share on other sites

@@altoid

 

thanks, also a nice idea, then you simply put your static 404 custom URL into the Header Status Handler value field ?

where I have:

Redirect To server_error.php?id=404

you have

Redirect To 404.html

 

But does this not break out of the look and feel of your store ?

 

@@Jack_mcs

thanks for taking care of this, it's working very well for now :thumbsup:

Share this post


Link to post
Share on other sites

@@altoid

 

But does this not break out of the look and feel of your store ?

 

 

It does but there are css examples there and discussion about how to modify the look of the page. I haven't done that though...maybe down the list on my huge "to do" list.

 

I haven't used the add on Jack mentioned but that may opt better.

 

Good luck.


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.

Share this post


Link to post
Share on other sites

Hello

 

Great contrib, but i get this error, when i press the review button on a product after installing it:

 

1054 - Unknown column 'r.reviews_status' in 'field list'

 

select r.reviews_status as status from reviews r left join reviews_description rd on r.reviews_id = rd.reviews_id where r.products_id = '4956' and rd.languages_id = 4

 

My shop is V2.2 and i manuel installed the newest version 2.2 addon from 25-7-2013

 

What can be wrong ?

Share this post


Link to post
Share on other sites

That's because that field in the database isn't in your database. It is in later versions and some addons. You can try one of the fixes mentioned here. Please let me know if that doesn't do it and I will take a look at the code.

Share this post


Link to post
Share on other sites

Hi Jack

 

Thank you for the answer.

 

Should i try to run this on my database ALTER TABLE `reviews` ADD `reviews_status` TINYINT( 1 ) NOT NULL DEFAULT '0' AFTER `last_modified` ?

Share this post


Link to post
Share on other sites

I tried the above. Now the tep error dissaper, but when you press the review button products with reviews i get the 404 pagenot found. So maybee i should be

ALTER TABLE `reviews` ADD `reviews_status` TINYINT( 1 ) NOT NULL DEFAULT '1' AFTER `last_modified` , but the contrib will not Work on reviews ...

Share this post


Link to post
Share on other sites

Changing the default database value to '1' is working. But i guess that the contrib now doesnt make 404 error pages for deleted reviews now ?

But never mind the rest i working fine now. Thank you for your help-

Share this post


Link to post
Share on other sites

There might also be an issue with the 404/410 redirects.

 

The 404 should be used for hidden products, categories etc.. as they might get 'unhidden' when you get the product back in stock after a long time. (410 Means permanent Gone).

The 410 should only be used for deleted products, categories etc. that never will be back on the sam url?

 

http://www.w3.org/Protocols/rfc2616/rfc2616-sec10.html

Share this post


Link to post
Share on other sites

I don't have IE 11 installed so I can't address that problem. I don't know how to respond to "there might also be an issue." The code is setup to return either a 404 or 410 based on the product in the database. I've not had any problems with it.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×