Canonical URL not used

  • Posts: 130
  • Thank you received: 2
  • Hikashop Business
9 years 8 months ago #168944

-- HikaShop version -- : 2.3.2
-- Joomla version -- : 3.3
-- PHP version -- : 5.3.28
-- Browser(s) name and version -- : All
-- Error-message(debug-mod must be tuned on) -- : None

I created a new site with Hikashop installed, and I want to avoid duplicate URLs as much as possible. I have set "force canonical URLs on listings", and also added a canonical URL (webshop/product/strassburg-sock) for one of my products, but different canonicals are generated depending on how I access the product:

  • From the shop (product-listing menu), I get the URL webshop/product/strassburg-sock, which has canonical webshop/product/strassburg-sock (same), which is also the canonical I created in the product configuration.
  • From the Hikashop Content module on the homepage I go to URL component/hikashop/product/strassburg-sock, with also this canonical. Apart from the fact that the canonical URL does not seem to be created as wished, I would also like this link to go to the main URL for the product, as it also is a location which does not reflect the correct module positions.

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
9 years 8 months ago #168953

Hi,

The canonical url is unique, it is added in the meta data of the page, so for the seo there is no problems.

Now for a better sef experience, you have to edit the content module "menu" option in order to select a menu with the desired url ;)

Please Log in or Create an account to join the conversation.

  • Posts: 130
  • Thank you received: 2
  • Hikashop Business
9 years 8 months ago #169052

Thanks for pointing out the "Menu" option in the module, I missed that ;)

Then about canonical URLs: Even though the products from the module are routed to the correct page now, the original URL still exists, being:
xxx.xx/component/hikashop/product/strassburg-sock , with the following canonical URL:
<link href=" xxx.xx/component/hikashop/product/strassburg-sock " rel="canonical" />

The 'correct' page for the product is xxx.xx/webshop/product/strassburg-sock , with this canonical:
<link href=" xxx.xx/webshop/product/strassburg-sock " rel="canonical" />

This means 2 almost similar pages on 2 URLs. For SEO purposes, they should have the same canonical, right?

Please Log in or Create an account to join the conversation.

  • Posts: 13201
  • Thank you received: 2322
9 years 8 months ago #169053

Hi,

Which value do you have selected for the option "force canonical URLs on listings" ?

You should have: "Use canonical URL and generate it if missing", this way if a canonical url exist, it take it, else it is generated. But there is only one url for one product.

Please Log in or Create an account to join the conversation.

  • Posts: 130
  • Thank you received: 2
  • Hikashop Business
9 years 8 months ago #169137

Yes, I have the setting: "Use canonical URL and generate it if missing"

Please check my test-site. I have 2 URLs for the same product:

xxx.com/component/hikashop/product/strassburg-sock
http:/xxx.com/webshop/product/strassburg-sock

Both URLs are for the same product. The first one is nor really in use, it is not linked from a menu or so, but it is definitely an existing URL, and a case of duplicate content. If the canonical URL would be used (I configured it to be/webshop/product/strassburg-sock), it would not be an issue, but the canonical URL for this URL is a different one, please check the source code for the 2 URLs.

Last edit: 9 years 8 months ago by simonkloostra. Reason: Hide URLs

Please Log in or Create an account to join the conversation.

  • Posts: 81604
  • Thank you received: 13082
  • MODERATOR
9 years 8 months ago #169141

Hi,

Edit your module via the menu Display>Content modules and set the "menu" option to your "webshop" menu item. That should automatically solve the problem.

Please Log in or Create an account to join the conversation.

  • Posts: 130
  • Thank you received: 2
  • Hikashop Business
9 years 8 months ago #169189

Hi Nicolas, I already did that, plus I have set "force canonical URLs on listings" to "Use canonical URL and generate it if missing", and even set a specific canonical URL in this product.

The URL I have issues with is not directly accessible via any menu or module, so for my users I have no issues. My issue is that, even though the URL xxx.com/component/hikashop/product/strassburg-sock is not directly accessible, it is still around, and Google will for sure find it when indexing the site.

Also I do not mind that is there, as long as the canonical URL for the page would point to the correct one: xxx.com/webshop/product/strassburg-sock
As this is not the case, it will be indexed as a separate page with duplicate content.

Last edit: 9 years 8 months ago by simonkloostra. Reason: Hide URLs

Please Log in or Create an account to join the conversation.

  • Posts: 130
  • Thank you received: 2
  • Hikashop Business
9 years 8 months ago #169315

Is this still looked at?

Please Log in or Create an account to join the conversation.

  • Posts: 130
  • Thank you received: 2
  • Hikashop Business
9 years 8 months ago #169520

Sorry for being impatient, but is this still looked at?

Please Log in or Create an account to join the conversation.

  • Posts: 81604
  • Thank you received: 13082
  • MODERATOR
9 years 8 months ago #169591

Hi,

Sorry for the delay.

You can't prevent a valid URL from working. That's why the canonical URL system is in place so that Google knows the main URL of the product.
I wanted to look at your links in order to try to find more clues, but there is a htaccess blocking the access.
And looking at our code, there is no reason the canonical URL on the product page wouldn't be the one you entered in the product edition interface. So the only things I could think off would be that you don't have the correct URL in the canonical URL field of the product or that you have some caching on your website which prevents you from seeing the correct canonical URL in the header of the page.

Please Log in or Create an account to join the conversation.

  • Posts: 130
  • Thank you received: 2
  • Hikashop Business
9 years 8 months ago #169593

I did not want to leave the test-site exposed for too long, which is why I locked the site with .htaccess last friday, but I opened it up again now. I definitely have no caching active. I also attached a screenprint of the canonical URL setting for the product now.

Attachments:

Please Log in or Create an account to join the conversation.

  • Posts: 81604
  • Thank you received: 13082
  • MODERATOR
9 years 8 months ago #169594

Mmmm. That's really strange.
Could you provide a backend access and a FTP access so that we can check your settings and put some traces in the code in order to analyze what's going on on your website ?
You can use our contact form in order to provide that along with a link to this thread:
www.hikashop.com/support/contact-us.html

Please Log in or Create an account to join the conversation.

  • Posts: 130
  • Thank you received: 2
  • Hikashop Business
9 years 8 months ago #169688

Hi, I have just sent the login credentials. Feel free to troubleshoot as much as you want. I have created backups of the site that I can easily restore if needed.

Please Log in or Create an account to join the conversation.

  • Posts: 81604
  • Thank you received: 13082
  • MODERATOR
9 years 8 months ago #169796

Hi,

So from what I can see, the problem is actually not in HikaShop.
HikaShop actually always display the correct canonical URL. If you look in the header of the product page, you'll actually see two canonical URLs. The correct one, added by HikaShop, and the wrong one, added by the system SEF plugin of Joomla.
If you disable that plugin, then you only get the canonical URL from HikaShop on the product pages.
It seems to be a common problem with that plugin from what I could find online:
forum.joomla.org/viewtopic.php?f=712&t=833986

Please Log in or Create an account to join the conversation.

  • Posts: 130
  • Thank you received: 2
  • Hikashop Business
9 years 8 months ago #169807

Hi Nicolas, OK, that seems to be the issue. However, that means this is an issue for any Hikashop site, right? ven of you are not aware, many sites will have product URLs with the /component/hikashop/ format sitting somewhere. Speaking as a non-programmer, I would expect any component that sets canonical URLs to remove the Joomla-generated canonical. As an example, the Canonical plugin by Styleware corrects known issues in Joomla-canonicals by removing the one from Joomla and generating it's own.
Since Joomla cannot "know" that a component generates it's own canonicals, you cannot blame it for generating one, right? So I guess that this is something that should be looked at by Hikashop?

On the practical side, I will probably reroute the incorrect URLs using a 301-redirect (either in Joomla, or using SH404SEF). Since my shop does not have many products, that is no problem.

Please Log in or Create an account to join the conversation.

  • Posts: 81604
  • Thank you received: 13082
  • MODERATOR
9 years 8 months ago #169938

You actually have your reasoning reversed.
HikaShop has no way of stripping out Joomla's canonical URL tag as Joomla adds it with a system plugin on the page, at the very end of the processing of the page and HikaShop has no control on the page after it.
On the other end, the Joomla plugin has all the luxury to check on the HTML of the page and not add its canonical URL tag if there is already one there. If will avoid the problem for HikaShop, but also for all the other extensions where this creates a problem.
It is also not a big problem for ecommerce websites since what you need is canonical URLs on your HikaShop products/categories. And if you want canonical URLs for your joomla articles/categories, there exist plugins for Joomla specialized in that which don't mess with the pages of other components.
So just don't use that plugin until it gets fixed.

Please Log in or Create an account to join the conversation.

Time to create page: 0.102 seconds
Powered by Kunena Forum