Canonical URL not generating right.

  • Posts: 9
  • Thank you received: 0
9 years 11 months ago #214499

-- HikaShop version -- : 2.5.0
-- Joomla version -- : 3.3.6
-- PHP version -- : 5.4.43

Hello,

i have a problem with how canonical urls are generated on a hikashop site i work on.

i have:

Force canonical URLs on listings: Use canonical URL and generate it if missing.

from Mass Actions i update the canonical_products and canonical_categories, but the URLs generated then have no sence, they have no relation with the parent category or else..

for example i have 2 products in a category after the last mass action > update the url of the first oroduct is :

/en/yarn/mirasol/product/6-ushia-pure-white
and the second is
/en/yarn/product/7-lilac-1720
instead of
/en/yarn/mirasol/product/7-lilac-1720

i have more that 500 products on the site and most of the canonical urls have nothing to do with the actual category or anything else on the site.

/en/component/hikashop/product/179-andes-4301-blue-purple

i`ve been trying to solve this since days and no success to locate the problem so i`ll appreciate any help.

Thank you.

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

  • Posts: 84305
  • Thank you received: 13700
  • MODERATOR
9 years 11 months ago #214506

Hi,

When the canonical URL of a product is empty and that you let the system generate it, what it will do is that the first time it has to generate a link to the product page, it will generate it based on the settings of the listing.
So if you configured a products listing module without a target "menu" in the HikaShop settings of the module, and that the first link to the product page is for that module, the link will look like /en/component/hikashop/product/179-andes-4301-blue-purple
because no menu means that the Joomla SEF system cannot replace component/hikashop by the alias of the menu.
So what you want to do is either:
- clear all the canonical URLs, and go the pages where you have the listing with the correct URLs you want for your products (and maybe temporarily disable the modules that are not configured properly).
- or you can keep the "force canonical URLs on listing" setting turned off in the HikaShop configuration and get the URL of the products you want and copy/paste in the canonical URL of each product. Then, activate back the option and the URLs will be kept like you want them.
- or you configure the modules properly so that they lead to the correct menu item, etc and when you clear the canonical URLs, it will regenerate them with the correct URL regardless from where you access the product. But that's not easy to configure all the listings exactly like you want.

The following user(s) said Thank You: Pleko

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

  • Posts: 2668
  • Thank you received: 69
9 years 11 months ago #214582

Sorry to join the thread but I had the same problem and I think that hikashop should generate canonicals exactly in the same way not depending on menu or whatever
Therefor I did it myself with SQL
product_canonical = CONCAT('mydomain', '-', nameSEFforproducts, '-', product_id, '-', product_alias )

I find mydomain and namesef in the table hikashop config

The following user(s) said Thank You: Pleko

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

  • Posts: 9
  • Thank you received: 0
9 years 11 months ago #214616

Hi nicolas,

thanks for the answer it gave me a bit better understanding on how hikashop works.

yesterday after some more lurking around the database i came out with your 2nd solution, i turn OFF the Force canonical URLs, and reset the URLs.

What was really messing the things was a listing module that i set as Carousel on the front page and some listing modules set without a menu.

Last edit: 9 years 11 months ago by Pleko.

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

Time to create page: 0.067 seconds
Powered by Kunena Forum