Canonical not working in sitemap

  • Posts: 48
  • Thank you received: 1
7 years 10 months ago #271707

-- HikaShop version -- : 3.1.1
-- Joomla version -- : 3.7.2
-- PHP version -- : 7.3

I have configured canonical urls for all items within my store on the backend but none of the links are working at all via sitemap. Using sitemap pro as the sitemap generator. I have the Force canonical URLs on listings set to Use canonical if specified as well. Not sure what else setting to look at to make the links work within the sitemap.

Click the link below and you will see none of the links work under products option
revelprints.com/index.php?option=com_jmap&view=sitemap

Thanks N Advance!

Last edit: 7 years 10 months ago by 41global.

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

  • Posts: 83674
  • Thank you received: 13545
  • MODERATOR
7 years 10 months ago #271723

Hi,

Ok, let's take an example.
On your homepage you have a module listing products. On it, there is a link to that product page:
www.revelprints.com/related/products/justtravel-women-tee.html
If you check at the header of that page, you can see that the canonical URL is:
www.revelprints.com/justtravel-women-tee
monosnap.com/file/Z8IyqPdZEMgsDnpKUt9KAzOEEogBQ8
So I assume that you've entered the URL www.revelprints.com/justtravel-women-tee in the "canonical URL" field of your product (or the relative path /justtravel-women-tee).
However, if you have the "force canonical URLs on listings" setting activated, the canonical URL should be used on the products listings. As you can see, that's not the case since on the homepage you get the URL www.revelprints.com/related/products/justtravel-women-tee.html instead of www.revelprints.com/justtravel-women-tee
And if I check that product on your sitemap, I can see the canonical URL there:
revelprints.com/justtravel-men-tee

What that all indicates is :
- Your sitemap is correctly using the canonical URL of the products.
- Your module on the homepage is either not a HikaShop content module, or a HikaShop content module which has been customized and doesn't take into account your canonical URLs, so that should be fixed.
- The canonical URL you entered in your product is wrong. In the canonical URL field of the product, you're supposed to enter a valid URL of the product page. The URL www.revelprints.com/justtravel-women-tee is not valid, and thus you shouldn't enter it. You should enter instead valid URL like for example www.revelprints.com/related/products/justtravel-women-tee.html

What you need to understand is that the canonical URL system is not a way to change the structure of the URL leading to the product page. If want to customize the URL of the product pages, what you need to use is a SEF alias system like the one in sh404SEF. Canonical URLs are only a way for you to say to search engines "this is the URL that I want you to index for that page" and the "force canonical URLs on listings" setting allows you to display that URL on the listings. That's all. It not a system made to have aliases of the product pages URL so that you can have whatever link you want to access a product page.

The following user(s) said Thank You: 41global, renem

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

  • Posts: 48
  • Thank you received: 1
7 years 10 months ago #271745

Thanks a bunch, looks like i was entering the wrong Canonical url and also the Latest Products homepage module was also doing something wrong as well. Thanks for the detailed message and explaning Canonical urls

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

Time to create page: 0.142 seconds
Powered by Kunena Forum