问题原文
原帖链接 · JAT86 · CC BY-SA 4.0
We have a static site that has thousands of HTML pages and are planning to switch to HTTPS in the next few days. As the site is fairly new, we do not have any problems with duplicate content at the moment, which is why we never added a rel="canonical" link tag on any of our pages.
Now, we want a permanent redirect for all of our site's pages from HTTP to HTTPS, and no longer want to have an insecure HTTP version. We want all old HTTP links to redirect to the HTTPS version. However, I am worried that Google might index the HTTPS version separately and leave the old HTTP version in the Search Results index thus creating duplicate content.
Is a 301 Redirect in the .htaccess file enough to prevent duplicate indexing by Google, or do we also need to add a canonical tag for each and every page? (we want to avoid adding canonical tags due to maintenance issues since our site is static)
已采纳解答
原帖链接 · Simon Hayter · CC BY-SA 4.0
No canonical links are not required if 301 redirects are working to the correct page(s), however, it should be noted that using canonical links is considered a best practice.
Canonical links are a great 'fall-back' should mod_rewrite behaviour become undesirable or stop working completely, this can often occur when upgrading Plesk, Cpanel or Apache. In short, I recommend that you use canonicals even when your pages are only accessible via a singular URL.
摘自公开归档,保留原文语言,版式经整理,外部媒体与邮箱地址已移除。
