News:

You may pay someone to create your store, or you visit our seminar and become a professional yourself with the silver certification

Main Menu

Duplicate Products Url and wrong rel="canonical"

Started by mediacompadova, March 02, 2016, 16:18:24 PM

Previous topic - Next topic

mediacompadova

Hi everyone,
I've this huge problem. I'm italian, sorry if i can't speak english well at all.
http://couponviaggio.it/ This is a travel company site, with virtuemart, and it has many seo problems.

Products that belong to 1+ categories, have duplicate URLs. For example:
http://couponviaggio.it/regioni-italiane/regione-abruzzo/hotel_city_montesilvano-detail.html
http://couponviaggio.it/mare/vacanze-mare-abruzzo/hotel_city_montesilvano-detail.html

This is the same product, but it is reachable by 2 URLs, and this create a duplicate.

At this point i think, maybe the rel="canonical" is set to one url for both URLs. But it's not so.
This is for the first:  <link href="http://couponviaggio.it/regioni-italiane/regione-abruzzo/hotel_city_montesilvano-detail.html?limitstart=0&amp;limit=int" rel="canonical" />
This is for the second: <link href="http://couponviaggio.it/mare/vacanze-mare-abruzzo/hotel_city_montesilvano-detail.html?limitstart=0&amp;limit=int" rel="canonical" />

The canonical URL is the URL where you are in! And it has no sense.
What i have to do for fix these problems?
Thank you, and have a nice day!

Ghost

What version of VM is that? 3.0.2? I suggest you update first. There are some canonical URL changes in more recent versions.

Studio 42

You have another problem :
in your html header:
eg.
<link href="http://couponviaggio.it/mare/offerte-mare-italia/hotel-le-torri-arborea-detail.html?limitstart=0&amp;limit=int" rel="canonical" />
  <link href="/mare/offerte-mare-italia/hotel-le-torri-arborea-detail.html" rel="canonical" />


And all 2 are bad !
First have all and second is better using full link(but second is better)
So i think perhaps your template or a plugin (or SEF tool) add the first one, because second one is generate by virtuemart.

GJC Web Design

As Ghost said.. are u using VM3.0.12+ as there has been work done on this area recently
GJC Web Design
VirtueMart and Joomla Developers - php developers https://www.gjcwebdesign.com
VM4 AusPost Shipping Plugin - e-go Shipping Plugin - VM4 Postcode Shipping Plugin - Radius Shipping Plugin - VM4 NZ Post Shipping Plugin - AusPost Estimator
Samport Payment Plugin - EcomMerchant Payment Plugin - ccBill payment Plugin
VM2 Product Lock Extension - VM2 Preconfig Adresses Extension - TaxCloud USA Taxes Plugin - Virtuemart  Product Review Component
https://extensions.joomla.org/profile/profile/details/67210
Contact for any VirtueMart or Joomla development & customisation

sandomatyas

I have this problem too. There are two different canonical urls, the first one is absolute and the right one, the second one is relative and wrong.
Joomla version is 3.5.0, VM version is 3.0.14
I checked the source and found this in views/productdetails/view.php.html:

// remove joomla canonical before adding it
foreach ( $document->_links as $k => $array ) {
if ( $array['relation'] == 'canonical' ) {
unset($document->_links[$k]);
break;
}
}

// Set Canonic link
if($isCustomVariant !==false and !empty($isCustomVariant->usecanonical) and !empty($product->product_parent_id)){
$parent = $product_model ->getProduct($product->product_parent_id);
$document->addHeadLink( JUri::getInstance()->toString(array('scheme', 'host', 'port')).JRoute::_($parent->canonical), 'canonical', 'rel', '');
} else {
$document->addHeadLink( JUri::getInstance()->toString(array('scheme', 'host', 'port')).JRoute::_($product->canonical), 'canonical', 'rel', '');
// }


The problem is that $document->_links is empty at this point.
The reason is that Joomla 3.5.0 moved it's canonical url handling from onAfterRoute() to onAfterDispatch() in the sef system plugin.

Also checked the issue in Joomla! Issue tracker and found that 3.5.1 will solve the problem: https://issues.joomla.org/tracker/joomla-cms/9565
I checked the patched version and seems a solution so all we need is wait for Joomla 3.5.1 :)