Developer forum

Forum » CMS - Standard features » Canonical url in meta

Canonical url in meta

Adrian Ursu
Reply

Hello guys,

How is this canonical URL meant to work?

I have checked both options in Management center/Web and Http/Customized URL, restarted IIS and I still don't get any canonical URL in meta.

Now what? Is there any tag I need to add in Master file?

Thanks,

Adrian

Screen_Shot_10-27-15_at_05.58_PM.PNG

Replies

 
Nicolai Høeg Pedersen
Reply

You need the meta tag in the master file - it should be there automatically if you have not disabled head parsing.

But where do you not see it? When on a product that is located in different locations, you need to specify primary group and primary page on that group before the canonical shows up.

BR Nicolai

 
Adrian Ursu
Reply

I have not disabled Head parsing (the analytics code is showing)

I don't see it in any page.

I have checked Regular pages, Homepage, Category Page and Product page :)

We have an IIS PAge Spped module that does some processing but I have also tried with it disabled without any luck.

Products are only aloocated to a single category.

I cannot assign Primary page on the group because they are recreated after each sync. The same happens to the products. We are using Norriq's integration module.

Thank you,
Adrian

 

 
Nicolai Høeg Pedersen
Reply

Hi Adrian

Need a URL to check it out....

BR Nicolai

 
Adrian Ursu
Reply

http://www.ppt.ro

 

 

 
Nicolai Høeg Pedersen
Reply

Hi Adrian

You have disabled head parsing... See dump.

You are also missing meta keywords and description. So just add the "MetaTags" template tag to the header.

BR Nicolai

Capture.PNG
 
Adrian Ursu
Reply

Thanks a lot. I have solved it.

I am not sure why my team has disabled that parsing in the first place. Probably was something to do with performance.

Thanks,

Adrian

 
Nicolai Høeg Pedersen
Reply

Hi Adrian

I think it was disabled because of all the custom meta tags in the head section and so they can control how it behaves. There is no performance related to it, since it only happens once when the layout is being reparsed.

BR Nicolai

 
Adrian Ursu
Reply

Thanks.

I have managed to make it work, thanks a lot for that.

Now the customers sent a question related to best practise/google recommendations:

 https://support.google.com/webmasters/answer/139066?hl=en

"...
Avoid errors: use absolute paths rather than relative paths with the rel="canonical" link element.

Use this structure: https://www.example.com/dresses/green/greendresss.html
Not this structure: /dresses/green/greendress.html)."

Our pages have this: "<link rel="canonical" href="/produse/femei/imbracaminte/blugi"/>"
According to Google it should be <link rel="canonical" href="http://www.ppt.ro/produse/femei/imbracaminte/blugi"/>

Does it have to do with <base href="www.ppt.ro"/>

That's why we don't have the same rule?

Thanks,

Adrian

 
Nicolai Høeg Pedersen
Reply

Hi Adrian

Basically because we cannot be sure which of your domains to use - unless a primary domain is specified. Then we could do it.

DW indicates the preferred domain using the primary domain setting and uses 301s to ensure bots to only catch on that domain.

Nicolai

 
John Andersen
Reply

Hi Nicolai,

(sorry for resurrecting thread, but I still havent found solution).

We are now 2 years down and even though we have set primary domain the canonical URLs are all still relative. See fx http://www.kontaktlinseinstituttet.dk/Kontaktlinser

Please advice if any solution is coming.

Best regards

John

 
Nicolai Pedersen
Reply

Hi John

This thread handles canonicals for products in Ecommerce that are published in multiple URLs. You have just regular content pages and only one domain and only the same content once.

You should basically disable canonicals on this page as they have nothing to do here... There are no domain involved here because of the base href tag handles that in this scenario.

BR Nicolai

 
John Andersen
Reply

Hi Nicolai

Thank you very much for your answer, however from an SEO standpoint we prefer to have canonical meta tag on all pages, and Google specifically points out that you should use absolute urls. For both ecom as well as basic content

https://support.google.com/webmasters/answer/139066#2

Avoid errors: use absolute paths rather than relative paths with the rel="canonical" link element.

Use this structure: https://www.example.com/dresses/green/greendresss.html Not this structure: /dresses/green/greendress.html

How is it possible with DW?

 
Nicolai Pedersen
Reply

Also according to Google canonicals should be used for pages with multiple urls which you have not because of your setup: https://support.google.com/webmasters/answer/139066?hl=en

And it is not a requirement to use absolute urls. link tag supports relative tags and are backed by base href that uses your primary domain. So you are all good. Otherwise feel free to change it in your template or use the canonical field on the page properties to specify exactly what you think is right.

BR Nicolai

 

You must be logged in to post in the forum