Search…

X3 Photo Gallery Support Forums

Search…
 
User avatar
christianch
Experienced
Topic Author
Posts: 51
Joined: 08 Mar 2021, 03:27

canonical link

06 Apr 2024, 05:35

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
 
User avatar
mjau-mjau
X3 Wizard
Posts: 14154
Joined: 30 Sep 2006, 03:37

Re: canonical link

07 Apr 2024, 22:28

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.
 
User avatar
christianch
Experienced
Topic Author
Posts: 51
Joined: 08 Mar 2021, 03:27

Re: canonical link

08 Apr 2024, 06:27

Many thanks !