How to Migrate from HTTP to HTTPS – Complete Tutorial

So after recently going through a migration from HTTP to HTTPS for a client I wasn’t happy with the documentation and tutorials I found online so I decided to write my own. If you miss one thing, such as moving over your disavow file it can be disastrous. This tutorial does assume you are using WordPress, but most of it is applicable for any platform.

Choosing a SSL Certificate

First you will need to decide if you need a single, multi-domain (use on more than one domain), or wildcard certificate (use on unlimited subdomains). Google recommends using a 2048-bit key certificate or higher.

I highly recommend getting a EV SSL certificate. It is more expensive, but you get the green bar in your address bar which could help build assurance that things are secure on your site. But there are also certs that will work for as low as $9 a year.

green bar EV SSL

I won’t be going over the installation of the cert here. I would just recommend having your host do it for you if you don’t know how.

HTTP to HTTPS Checklist

Now to get down to business! Some of these might not be applicable for you, but I wanted to be thorough.

Step 1 – Turn off CDN

The very first thing to do is disable/turn off your CDN if you are running one. I am using the free WordPress CDN Enabler plugin so under Plugins in WordPress I temporarily disable this plugin.

disable cdn enabler

Step 2 – Clear your Website’s Cache

The next thing you want to do is clear the cache on your website. I am using the free WordPress Cache Enabler plugin so in the top right corner of the WordPress dashboard I click on “Clear Cache.”

clear cache wordpress

Step 3 – Update all Database and Hardcoded Links to HTTPs

Now it is time to update and replace those HTTP links in the database and your URLS to HTTPS. For this I use an awesome free tool from Interconnect IT called “Database search and replace script in php.” If you aren’t comfortable doing this you can also use the free Really Simple SSL plugin.

I do recommend doing this on a dev server and moving it back, or at least backing up your database first to be safe as this script does grab your local database credentials. Simply drop their program into the root of your site via FTP.

drop search replace into ftp

Then browse to it in your browser. (I named my folder “search-replace-db”)

search and replace script

You can then insert what you want to replace. Make sure you enter all of the formats you have mixed and matched over the years such as:

  • http://mydomain.com to https://mydomain.com
  • http://www.mydomain.com to https://mydomain.com

search replace http to https

I then recommend running a “dry run” first to see what it will be updating/replacing. Then when you are ready click on “live run.”

search replace run

Note: This will update all of your entries in your database, including your WordPress Site URL, hardcoded links on pages and posts, etc.

Step 4 – Update all CDN URLs to HTTPS

Now if you are using a CDN you will want to run this procedure again. I use KeyCDN. Most likely you have a few hardcoded CDN URLs floating around.

search replace cdn urls

Make sure after you are done with the search and replace script to remove it! You can do so by clicking on the “Delete Me” button or remove it manually via FTP from your server.

delete search replace

Step 5 – Update Custom JS, Ajax Libraries to HTTPS

Next if you have done anything custom on your WordPress install, like include a jquery library, custom scripts, etc…, you will want to make sure those are also updated to HTTPs. For Google’s jquery you can simply point it to their HTTPs hosted version: https://ajax.googleapis.com/ajax/libs/jquery/2.1.3/jquery.min.js

Step 6 – Add 301 Redirects

Now you need to add a 301 redirect to all of your new URLs (pages/posts). I don’t advise using a WordPress plugin as this can be very time consuming. Simply add the following code to your .htaccess file via FTP. (if you aren’t comfortable doing this ask for help as you can break things) Also make sure to change the code depending upon whether or not your domain uses www.

Apache

RewriteCond %{SERVER_PORT} 80 
RewriteRule ^(.*)$ https://www.yoursite.com/$1 [R=301,L]

Here are some additional examples of using htaccess redirects.

NGINX

server {
listen 80;
server_name domain.com www.domain.com;
return 301 https://domain.com$request_uri;
}

Step 7 – Update Origin URL on CDN

Now we need to update the origin URL at KeyCDN. Under your pull zone settings in the dashboard, update the Origin URL to HTTPS and click “Save.”

keycdn origin URL

Step 8 – Install SSL Cert on CDN

KeyCDN has Let’s Encrypt integration which means SSL certs are completely free! Click into the advanced settings of your KeyCDN zone and enable Let’s Encrypt under SSL.

keycdn let's encrypt

Add a CNAME record in your DNS (Zonealias → Zone URL). DNS changes take some time depending on the TTL. Check that your new DNS record is active with the DNS Check Tool.

cname check dns

Create a Zonealias for that zone. Note: If your zone already has a Zonealias, you must either remove it before changing the SSL option to LetsEncrypt or recreate it afterwards. Further, you cannot add a Zonealias if the CNAME record is not fully propagated.

Step 9 – Enable HTTP/2 on CDN

Then I recommend double checking to make sure HTTP/2 is enabled.

HTTP/2 is a networking protocol for low-latency transport of content over the web. Originally started out from the SPDY protocol, now standardized as HTTP version 2. (source: caniuse)

In the KeyCDN dashboard under advanced features make sure HTTP/2 is enabled.

cdn enable http2

Step 10 – Update CDN URL in CDN Plugin + Re-enable

Now make sure you update your CDN URL in your CDN or caching plugin and turn the CDN back on. So I re-enable the WordPress CDN Enabler and I click into the settings. I update the URL to HTTPS and also check the CDN HTTPS box. Then click on “Save Changes.”

https cdn enabler

Step 11 – Update Sitemaps Function File to Point to new HTTPS CDN URL

If you are running a CDN you probably had to follow this tutorial “How to Fix Images Not Indexing on a CDN.” Well now we need to actually update that function to point to the HTTPs version in your WordPress functions.php file. See example of updated version below.

functions file fix images indexing maxcdn

Step 12 – Create new Google Webmaster Tools Site

Now you need to create a new Google Webmaster Tools site for the HTTPS version of your site. Simple add another site your HTTPS domain.

add https site

Remember to setup the same settings you have on your original GWT site, such as international targeting, etc.

Step 13 – Create new Google Webmaster Tools Site for CDN

If you are running KeyCDN you will also want to create a new GWT site for your HTTPS CDN domain. (See step 14 for why I have to create a separate GWT site for my CDN)

gwt https cdn

Step 14 – Submit Sitemaps to new GWT Site

Next make sure to submit your new sitemap file to Google Webmaster Tools. Make sure you are grabbing your new HTTPS sitemap URL.

submit https sitemap

Step 15 – Fetch and Crawl

I then recommend doing a fetch and crawl on your new HTTPs site just to get things moving a little faster. In some of my migrations to HTTPs I have seen it take weeks for Google re-crawl everything correctly.

What I do is usually fetch my homepage and then click on “Submit to index.”

fetch as google

Then choose “Crawl this URL and its direct links.” If you have some very important pages too that might not be connected to your homepage you could also submit them individually for re-crawling.

crawl this url

Step 16 – Resubmit Disavow File under new GWT Site

If you had a disavow file before under you original GWT site you will want to resubmit this file under your new HTTPS GWT site. This is very important! If you miss this step you could do a lot of damage to your site.

So head over to the Google Disavow tool under your original GWT site (HTTP) and download your disavow file.

disavow domains

Then launch the disavow tool again under your new HTTPS site and resubmit your file.

disavow links

disavow domains

Step 17 – Submit HTTPS Sitemaps to Bing Webmaster Tools

Then you need to re-submit your new HTTPS sitemap file to Bing Webmaster Tools. This is slightly different than GWT as you don’t have to create a new site. They simply need your new sitemap file and your good to go.

bing webmaster tools https

Step 18 – Create new Yandex Webmaster Tools Site

For Yandex you do need to create another new site for the HTTPS version just like GWT. Feel free to follow this tutorial on “How to Submit Your Website to Yandex Webmaster Tools“.

Step 19 – Submit Sitemaps to new YWT Site

You will then need to submit your new HTTPS sitemap file to your new YWT site.

yandex https

Step 20 – Update Google Analytics Profile URL

Then you need to update your Google Analytics Website’s URL. So under your account click into Admin and then your property settings. Then flip the URL to the HTTPS version. This way you don’t lose any history and can pick up right where you left off. Also update your view as well.

https google analytics

Step 21 – Re-link Webmaster Tools Site to Analytics Profile

Now you will want to re-link your Google Analytics profile with your new HTTPS GWT site. To do this click into Admin under Google Analytics and then your property settings. Scroll to the bottom and click on “Edit” under Webmaster Tools Settings.

webmaster tools site ga

Then choose your site and hit Save. You will get a prompt about un-linking your old association (HTTP). Simply say OK.

link gwt

And that’s it folks! You have now successfully migrated your site to HTTPs. You will want to monitor GWT for the next week or two to make sure everything starts indexing again in your new site. Also fix any crawl errors that come up right away.

Your new GWT site will most likely look like this after a few days and your old GWT site will drop off.

search queries

Step 22 – Re-Associate YouTube Channel Website

If you have a YouTube channel you will want to re-associate your website with your new HTTPS version in GWT. Otherwise you will get errors with annotations and other things in YouTube complaining about the HTTPS link being invalid.

In the YouTube dashboard click into your Channel and then into “Advanced.” Then change your domain to the new HTTPS version and click Add. You will have to then approve it by going into GWT, clicking into your messages for that site and click on approve.

re-associate youtube channel

Step 23 – Update Facebook App URL

If you have a Facebook App running for things like the WordPress SNAP plugin or a social login then you will need to update your App’s URL. So head over to https://developers.facebook.com/apps.

Click into your App.

facebook app

Then click into Settings on the left-hand side and update the Site URL and Mobile Site URL with the new HTTPS version. Then click Save Changes.

facebook app URL settings

Additional Things to Update:

  • Update Google AdWords URLs
  • Update Bing Ads URLs
  • Update AdRoll URLs
  • Update Facebook Ad URLs
  • Update MailChimp RSS Campaign URL (or any email marketing tool)
  • Update External Links (Social Media, Backlinks, etc)
    • Facebook website URL
    • Twitter website URL
    • Pinterest website URL
    • Google+ website URL
    • YouTube website URL

Scan Website for Non-Secure Content

There is an awesome free tool from the guys over at Jitbit to scan your website to check for non-secure content. This can be a quick way to diagnose anything you might have left behind. There is also a tool called HTTPS Checker which is pretty handy. It will scan your entire website for any HTTPS errors and provide you with an easy to read report. The free plan allows up to 100 pages.

Additional Things to Note:

  • If you are running Disqus it will automatically switch to HTTPS when migrating. I didn’t have to do anything. So the automatic switch usually works but sometimes I have found Disqus doesn’t pick up the new URLs. So you need to run their URL mapper tool to migrate your comments from the old HTTP URLs to new HTTPS URLs. If you are migrating both to HTTPs and a new domain you can follow my tutorial on how to “Migrate Disqus to a new Domain and Shortname.”
  • The WordPress Site URL is updated to HTTPS when you ran the updates in Step 4.
  • Adding “rel=canonical” tags is done automatically because when you change your WordPress Site URL Yoast updates your canonical tags.
  • If you are using a WordPress plugin like Simple 301 redirects all of your old redirect links were updated to point at the HTTPs version during your updates in Step 4.
  • Make sure to check that your robots.txt is accessible and working.

Will You See Traffic Improvements by Migrating to HTTPS?

I definitely saw a slight increase after everything settled back down from the migration. There is a very interesting article on “HTTPS Encryption – What is the impact of TLS/SSL on Rankings?

As of February 1st, 2016, John Mueller also posted up 13 answers to FAQs about HTTP to HTTPS migrations. Make sure to check it out.

As always feel free to leave your comments below! And if I missed anything please let me know.

GET MORE STUFF LIKE THIS

Marketing, WordPress, Blogging Tips, SEO and Reviews, once a week.

30 Comments

  1. Jules Webb May 13, 2015
    • Brian Jackson May 13, 2015
  2. Mike May 28, 2015
    • Brian Jackson May 28, 2015
  3. Arevico May 30, 2015
  4. befound1 September 23, 2015
  5. Gulshan Kumar December 7, 2015
  6. Ragul January 31, 2016
  7. Leo February 17, 2016
  8. Aaron Gray April 8, 2016
  9. Leo April 29, 2016
  10. Gibberish May 6, 2016
  11. Sven Raphael Schneider May 28, 2016
    • Brian Jackson May 28, 2016
  12. Drew June 10, 2016
    • Brian Jackson July 3, 2016
  13. Fizz Loyal August 17, 2016
    • Brian Jackson August 17, 2016
  14. Sharon Hurley Hall September 14, 2016
  15. Lisa Colwell September 23, 2016
  16. Ángel October 1, 2016
  17. Kees Romkes November 15, 2016
  18. Amresh January 10, 2017

Add Comment

258 Shares
Tweet
Share
Share
Buffer