Go Back   HostGator Peer Support Forums > Public Forums > Suggestions

Notices

Reply
 
Thread Tools
  #1  
Old 02-13-2008, 09:12 PM
ice203 ice203 is offline
Hatchling Croc
 
Join Date: May 2007
Location: Barberton, Ohio
Posts: 3
Cool osCommerce enhancement

Let's say... you have just deleted products out of your store. When a search engine comes back to check on that particular product page, osCommerce will still let the engine think it is still there with a 200 response code. The engine needs to know that products is no longer there. Well.. I have just the thing for you!

Most people would think of giving the search engine a nice... fat 404 to go away. Here is a better option: Send a 410 error code. What is that? The 410 is a not as well known cousin of the 404 which means "Gone". It lets a search engine know 2 things:

1) The product that was expected is now gone.
2) Any links you have to this page should be removed from your index. (Which is the best part)

Once you add this code, you will NOT see any difference in the page, nor will your visitors. This is only for the search engines to get rid of obsolete links to your store from their database. Not removing these can pull even the best of sites down in their rankings and is certainly not good for the unsuspecting customer who follows one of these links and sees "product not found".

At any rate, here are the two lines of code that I added to my product_info.php page to do this:

if ($product_check['total'] < 1) {
header('HTTP/1.1 410 Gone');}

Place this code just above the <doctype><head> statements in your page. On a new install, your code should be placed on line 19. If you place this code BELOW your <doctype><head> statements, I guarantee you will have header errors. Save it, upload it and you're done!!!

There are other ways of osCommerce doing this. As a matter of fact, there is 1 contribution that is in the osCommerce contributions section that mentions this, however it is a SEO type of thing that requires that you have other things installed as well. I thought... why all the hassle?? Here is 2 lines... and 5 minutes of work and that's it. No messing around with .htaccess files and such. So simple eh?

I hope this helps out many here to keep their rankings where they should be without "dead baggage"!
__________________
Iceman
Sunset Commodities Inc.
http://www.adultsexualsite.com
http://vod.adultsexualsite.com
Reply With Quote
Reply

Bookmarks

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off

Forum Jump

All times are GMT -5. The time now is 08:51 PM.