: When the HTTP site redirects to HTTPS what should the canonical URL tag point to? We have already 301 redirect from http://example.com to http://www.example.com and now we have redirect to https://www.example.com/
We have already 301 redirect from example.com to www.example.com and now we have redirect to www.example.com/
Now, the question is do we have to use the canonical i.e
<link rel="canonical" href="https://www.example.com" />
or
<link rel="canonical" href="http://www.example.com" />
Which one to choose and why?
More posts by @Reiling115
1 Comments
Sorted by latest first Latest Oldest Best
The clue is in the name... whatever is the canonical URL should go in the rel="canonical" element.
The rel="canonial" element, as it's name suggests, contains a reference to the canonical URL. There can only be one canonical URL. Since you have implemented SSL and are redirecting everything to HTTPS then that is now your canonical URL and that is what goes in the rel="canonial" element. So...
<link rel="canonical" href="https://www.example.com/">
Btw, the hostname actually ends in a slash. And you don't need the self-closing slash in HTML (that's an XHTML hang over).
Terms of Use Create Support ticket Your support tickets Stock Market News! © vmapp.org2024 All Rights reserved.