Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

v RC2a to v2.32


Juto

Recommended Posts

For the index.php I had canonical tags installed. Is there any benefit from keeping it, if so is this correct?

//Set unique tags for the current page

if (isset($_GET['manufacturers_id']) && tep_not_null($_GET['manufacturers_id'])) {
$head_tag ='<link rel="canonical" href="'tep_href_link(FILENAME_DEFAULT, 'manufacturers_id=' . $_GET['manufacturers_id'],'NONSSL',false);'" >'
} elseif ($current_category_id) { 
$head_tag ='<link rel="canonical" href="' tep_href_link(FILENAME_DEFAULT, 'cPath=' . $current_category_id,'NONSSL',false);'" >' 
} 

 $head_tag .= '  
 <META NAME="googlebot" content="index,follow">
 <META NAME="robots" content="index,follow">' . "\n";
//

 

Thanks for your advice

 

Sara

Link to comment
Share on other sites

Due to seo URL modules we have two urls for a product page in place:

1. Normal oscommerce url( spider crawled your site before you applied seo url so thay have these urls with them to crawl).

2. SEO url for product pages.

 

If you state canonical values then spiders will consider canonical urlas the final page and will not consider this url.So if you set canonnical url to seo url value duplucate content issue will be sorted out.

 

Satish

Ask/Skype for Free osCommerce value addon/SEO suggestion tips for your site.

 

Check My About US For who am I and what My company does.

Link to comment
Share on other sites

Hi satish, thanks for your reply. So using canonicals is the correct way to go in order to avoid penalties from search engines.

 

The above code snippet is meant for the index page, other pages like "specials", "featured products" and so on, need other snippets.

Do you know if there is a good contribution for this?

 

Sara

Link to comment
Share on other sites

You don't really need to have this

 

$head_tag .= '

<META NAME="googlebot" content="index,follow">

<META NAME="robots" content="index,follow">' . "\n";

 

The default behaviour of robots is to crawl and follow unless there is a block in robots.txt or a meta noindex directive. So there is no need to specify index, follow.

 

Implementing canonical tag correctly in a CMS like oscommerce is more complicated than most people think, and you may well be better off not specifying the tag at all. There is a standalone addon for canonical tag, which is easy to implement and configure. Recommend you use that rather than script your own code if you are novice.

 

http://addons.oscommerce.com/info/7163

Link to comment
Share on other sites

Archived

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

×
×
  • Create New...