Today, if you use a WordPress default installation and if you switch to HTTPS, a page URL will available from the HTTP & HTTPs version of your website URL without any 301 redirects between the two URLs.
Example:
http://yourdomain.com/yougreatpage/
Content of canonical tag: https://yourdomain.com/yourgreatpage/”
https://yourdomain.com/yourgreatpage/
Content of canonical tag: https://yourdomain.com/yourgreatpage/
In this case, Google would display https for every URL in the google search result. Google would know that the HTTPs version of every page is the default URL.
However, what would happen if someone would create a link to one or several URLs using the HTTP version not the HTTPS version???
Would the HTTPs version of a HTTP version benefit from the incoming link to the HTTP version of a webpage?
Example: someone creates a link on a page pointing to http://yourdomain.com/yougreatpage/ Would https://yourdomain.com/yougreatpage/ benefit from this incoming link? If we think about it, there are no redirects between the two URLs. So would the canonical tag be enough to mention to Google that it is the same URL?
Our investigation
We found only two videos from Google discussing 301 redirects vs canonical tags.
Those videos are outdated. I don’t know if back in 2009, Google knew how to handle HTTPS. We have difficulties to trust canonical tags. On the other hand, several Google communications reported that 301 redirects didn’t lose
Consequently, if you want to be on the safe side, have a 301 redirect between your former HTTP URLs and your new HTTPs URLs.
Add the following code to htaccess to redirect all HTTP urls to HTTPs:
RewriteCond %{HTTPS} off RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
Our opinion
Back in the day, when the canonical tag
Canonical tags should not be trusted for dynamic content. Some people may think that their content does not change. However, think about the rotating advertisements, the changing code inside your HTML, the timestamp inside your HTML, changing pictures and videos, Hosted iframe…