Page 1 of 1

canonical link

Posted: 06 Apr 2024, 05:35
by christianch
Hello, 

I notice in the head of my pages different canonical links for e.g:
Code
<link rel="canonical" href="https://lepetitbleausard.fr/Bleau/Cartes/Cuvier-Nord/">

<link rel="canonical" href="http://www.lepetitbleausard.fr/Bleau/Cartes/Rocher-Canon/2021_rocher_canon-7/">
How can I change the http to https for all the pages on my site?

Thanks a lot

Re: canonical link

Posted: 07 Apr 2024, 22:28
by mjau-mjau
That's because your website is enabled for both www and non-www, and http and https without any redirects, and therefore you get four possible links:
Code
http://lepetitbleausard
http://www.lepetitbleausard
https://lepetitbleausard
https://www.lepetitbleausard
X3 will add the canonical link based on the url when the page was requested, and then it will get cached. In your case, you should try to force a single access, recommended would be https://www. This can be achieved in .htaccess, see this post https://stackoverflow.com/a/36986520/3040364

For a simpler solution, you can use X3 Settings > Advanced > Force URL.

Re: canonical link

Posted: 08 Apr 2024, 06:27
by christianch
Many thanks !