URL problems when appending product name

  • Posts: 66
  • Thank you received: 1
5 years 5 months ago #300318

-- HikaShop version -- : 3.4.0
-- Joomla version -- : 3.8.10
-- PHP version -- : 7.2.11
-- Browser(s) name and version -- : Chrome 70 (64bit)

We are seeing an issue if a product URL is appended to any category URL (including categories it is not part of ) then the page is loading showing that product with an incorrect URL (showing the incorrect category), this is causing an issue with duplicate content.

For example, this is the correct URL:

www.fwdp.co.uk/park-furniture/litter-bins/product/alcorana-bin

But if you go to any category:

www.fwdp.co.uk/wayfinding/fingerposts

And make that URL the following:

www.fwdp.co.uk/wayfinding/fingerposts/product/alcorana-bin

This still loads the product page, but with a wrong URL and wrong breadcrumb.

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

  • Posts: 81539
  • Thank you received: 13069
  • MODERATOR
5 years 5 months ago #300325

Hi,

You should enter the URL you want for the product page in the "canonical URL" setting of each product.
That will add a meta tag to the product page stating that this is the main URL and other URLs reaching that page shouldn't be indexed by search engines. That way, it will avoid the "duplicate content" issues.
You can also set the "force canonical URLs on listings" setting of the HikaShop configuration to "Use canonical URL and generate it if missing" and that way when HikaShop generates a listing of products, it will automatically fill the canonical URL field with the URL generated for the product.

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

  • Posts: 66
  • Thank you received: 1
5 years 5 months ago #300362

That doesn't solve the issue though.

You can essentially append any product to the end of any category and it will load that page, it should be showing a 404 page surely?

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

  • Posts: 81539
  • Thank you received: 13069
  • MODERATOR
5 years 5 months ago #300381

Hi,

No, it's normal that you can access the same content with different URLs on a Joomla website, or pretty much any website when you know how it works. It's actually quite useful so that for example, if you have a product in several categories, the breacrumb on the product page of the product will be different based on the category from where you access the product. And in such case, the canonical URL is useful to tell the search engines to only index the link for the main category.
So the goal should not be to prevent that, which is not a problem in itself, but just to tell search engines that it's not duplicate content, just that they should only index the main URL, the canonical URL.

Now if you really want to setup 404 errors when the URL doesn't match with the main URL you want for your product pages, you would have to setup some SEF extension which can allow you to configure it.

Also, please note that your sentence "You can essentially append any product to the end of any category and it will load that page" is not correct. The URL www.fwdp.co.uk/wayfinding/fingerposts is not the URL of a category. It's the URL of a menu item associated with a category. But if you configure a menu item listing all your categories, without sub menu items for each sub category, you'll see that the URL of the sub categories are like that: www.fwdp.co.uk/my-main-menu-item-alias/c...ry/my-category-alias and if you then access a product of that category, you'll get that URL www.fwdp.co.uk/my-main-menu-item-alias/product/my-product-alias
If you try to append a product alias to a category URL, it will give you a 404 error as www.fwdp.co.uk/my-main-menu-item-alias/c...ias/my-product-alias is an invalid URL, structurally speaking.

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

Time to create page: 0.065 seconds
Powered by Kunena Forum