5

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)

4

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.

  • Thank your for the fallback info. But now I am equally worried that should we have to modify/rename the directories of some pages in the future, this would mean tediously fixing the hardcoded canonical tags of every page in that directory. – JAT86 Jun 15 '18 at 15:55
  • 1
    @JAT That can be done quite easily with a find/replace tool. Many text editors (such as Sublime Text or VSCode) can do replacements across a set of files in a directory. – DisgruntledGoat Jun 15 '18 at 18:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.