Jump to content
  • Checkout
  • Login
  • Get in touch

osCommerce

The e-commerce.

Product_info.php: Two URLS for every product - SEO nightmare!


adbart

Recommended Posts

Posted

Hi all,

 

I'm getting indexed in Google now for the same products twice over...

 

http://www.myshop.com/product_info.php?cPa...&products_id=12

 

is exactly the same as:

 

http://www.myshop.com/product_info.php?products_id=12

 

 

Does the 'cPath' part serve any purpose at all?!!!!?

 

I was wondering if anyone knows how to completely eliminate the use of 'cPath' from osC product links? Or is this not necessary??

Posted

You may have quite few modules and box files that you may need to modify but in any case here it goes for the product listing

 

Open you catalog\includes\modules\product_listing.php locate the following code:

 

			  $lc_text = ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ($cPath ? 'cPath=' . $cPath . '&' : '') . 'products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a> ';

 

change it to this:

			  $lc_text = ' <a href="' . tep_href_link(FILENAME_PRODUCT_INFO, ('products_id=' . $listing['products_id']) . '">' . $listing['products_name'] . '</a> ';

 

However backup your files before the mods and then do some thourough testing for the various aspects of the site like the breadcrumb etc.

 

You may have to do additional modifications to the application top to retrieve the cpath based on the products id as there're other functions that may use it. At least I had to do something similar because I am using the same product in related categories with linking.

Archived

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

×
×
  • Create New...