Product's URL confusing

  • Posts: 52
  • Thank you received: 1
  • Hikashop Business
6 years 8 months ago #296202

Hello,
I can't understand or I am confused about the way Hikashop builds products URLs:
E.g.:
I have a product (e.g. Product-A) with alias product-a belongs to some categories (e.g. category-a, subcategory-a1).
For every category, subcategory of my site I have build a menu item with the corresponding alias (e.g. category-a, subcategory-a1)

When I browse for this product I see all the correct URLs:
Main Menu -> Products -> Product A URL: www.mysite.com/products/product-a
Main Menu -> Products -> Category-a -> Product A1 URL: www.mysite.com/products/category-a/product-a
Main Menu -> Products -> Category-a -> Subcategory-a1 URL: www.mysite.com/products/category-a/subcategory-a1/product-a

However browsing my site, I discovered the same product with different URL containing a category alias that the product doesn't belong to.

Why does this happen?
Is there any way to control it?

Best wishes.
Makis

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

  • Posts: 83603
  • Thank you received: 13533
  • MODERATOR
6 years 8 months ago #296209

Hi,

The part befroe product-a in the URL is generated automatically by the Joomla SEF system using the alias of the current menu item and the aliases of its parent menu items. The fact that the menu item aliases and the menu item structure matches your categories is your doing but it's not necessary and HikaShop will be able to display a product from whatever category as long as the current menu item is a HikaShop menu item type.
And if you are browsing to the product page from a products listing module, then you have one menu item selected in the "menu" setting of the module. And thus in your case, it will correspond to one category regardless of the categories selected for the product.

Now, if you want to prevent that, and always have one URL used for your product regardless from wherever you come from on your website, you can fill the "canonical URL" field of the product with that main URL, and set the "force canonical URL on listings" setting of the HikaShop configuration to "Use canonical URL if specified".

Note even if you don't do that, just entering the canonical URL of your products is a good thing for your SEO to avoid "duplicate content" issues.

The following user(s) said Thank You: xatzopou

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

Time to create page: 0.051 seconds
Powered by Kunena Forum