Forum


HomeHomePremiumPremiumAdministrationAdministrationSetting the canonical url Setting the canonical url
Previous
 
Next
New Post
6/22/2017 4:38 AM
 

Hi Aderson,

I've just noticed that the canonical urls for a site is incorrect.

It's given as:
<link href="http://dnn8.dnndev.me/blog/thehike/week6/day39" rel="canonical" />

But 'dnn8.dnndev.me' is incorrect, that was the development url for the site.

I noticed that under 'Site settings > Advanced settings > Site Aliases', 'dnn8.dnndev.me' is set as the primary site alias.
The real site URL is present and set as the 'current' alias, but is not editable.

What do I need to do to set the canonical correctly?

Also, looking under 'Site settings' > 'basic settings '  the Site map url  is also incorrect. Are there any other places where I should change the url?

Best Regards,

Steve


 
New Post
6/23/2017 9:40 AM
 

Hi Steve,

To set the other domain as the primary VIA the UI you would have to load the site from the primary domain and then you would be able to change to the correct primary.

Assuming that you cannot load the site on the current primary domain (as it is live and no longer loadable via the dev domain), you will have to update the PortalAlias table and se the IsPrimary field from true to false for the current primary and from false to true for the new primary.

BTW, ensure you run both update queries at the same time (one line right after the other) as once you flip the IsPrimary flag the site may not behave well without having a Primary Alias, even if it is for a short while. I hope it makes sense.

Cheers,

Aderson

 
New Post
6/23/2017 10:06 AM
 

Hi Aderson,

Thank you for your reply.

That seems straight forward enough then. Just a couple of SQL update statements should do the trick.

Thank you once again.

All the best,

Steve

 

 
New Post
6/24/2017 12:05 AM
 

Hi Aderson,

 

I was also speaking to the hosting company about the canonical link, they have made the DB changes for me.

I would need to check exactly what they changed, but now the correct URL is the primary site. And 'site alias mapping mode' is set to 'canonical'.

But now there's no canonical link in the page. Is there something else that needs to change to force a canonical link tag to be generated?

Please see image below.

Best Regards,

 

Steve

 

 
New Post
6/24/2017 4:42 AM
 

Hi Steve,

It is my understanding that canonical links will ONLY show up if you load the site from a domain that is NOT the primary. Then the canonical link would show up pointing to the primary domain.

I hope it make sense.

Cheers,

Aderson

 
Previous
 
Next
HomeHomePremiumPremiumAdministrationAdministrationSetting the canonical url Setting the canonical url



Try FREE
30 days money back guaranteed