Want to retain your search engine traffic while moving from HTTP to HTTPS? Adding redirection of HTTP to HTTPS is tedious and needs careful planning. This step-by-step tutorial will resolve all your doubts and make the task clear and simple for you.

Heard the buzz around SSL and HTTPS enabled websites? As an increasing number of websites are adopting HTTPS, it seems that HTTPS is the way ahead for all data transfers on the Web. Are you still contemplating on whether to make the switch from HTTP to HTTPS for your website? Have you already decided to redirect HTTP to HTTPS for your website? Are you wondering about how to go about this not-so-simple looking task of moving your website or blog to HTTPS? Not to worry, we have recently upgraded the TemplateToaster blog to HTTPS and have all the steps tried and tested. Read ahead, for a step-by-step tutorial to redirect HTTP to HTTPS.

What is HTTPS?

HTTPS, as we already know from our previous article on SSL, is the protocol over which data is exchanged between a website and a browser. It is the secure version of HTTP which uses the SSL connections for communication over HTTPS. In other words,

HTTPS = HTTP + SSL

We have also learnt that HTTPS protects data by encrypting it using an SSL (Secure Sockets Layer) Certificate. The way HTTPS works is that it establishes an SSL connection, wraps the data into SSL packets and uses these packets for data transfer.

Before we proceed it is important to consider the primary benefits of moving your site to HTTPS. We know that Google has already added “HTTPS” as an important SEO ranking signal. It means that HTTPS websites will be at a higher SEO ranking in the google search than the HTTP ones. Google also has started using Chrome to warn users of the security risks in visiting non-secure HTTP websites. From January this year, Google’s Chrome started using a “not secure” label, for HTTP pages containing password or credit card form fields. Starting in October, Chrome will start using this label for all pages whenever users type any data into HTTP enabled web pages. So HTTPS is a better choice as it provides increased security, increased referral data, and a potential boost in SEO rankings.

It is to be noted that migration has to be done carefully and efficiently. Otherwise, it can have a negative impact on your website’s rankings. You need to ensure that you plan and implement each stage of the migration.

We have recently moved the TemplateToaster blog to HTTPS and have learnt the process of migrating from HTTP to HTTPS. We think it would be worth sharing our experiences and findings with all of you. Here is a tutorial on the steps involved in redirecting HTTP to HTTPS.

Redirect HTTP to HTTPS: Steps to follow

In brief, the generic steps to follow, if you want to redirect HTTP to HTTPS are listed below:

Purchase an SSL certificate: The first requirement for HTTPS is to purchase an SSL certificate for your website. There are many types of SSL certificates available. Select one based on your business needs.

Install the SSL certificate: Once purchased, the SSL certificate is to be installed on your website. The process requires generating both public and private encryption keys and adding them using the Web hosting control panel.

Update all internal and external links to HTTPS: Ensure all the internal and external links point to the new HTTPS URLs. Internal links include navigation/menu links, images, CSS references etc. If internally the website still references HTTP files, it will break. Make sure to change all external links and local directory listings to point to the new HTTPS website.

Set up 301 redirects from HTTP to HTTPS Implement a permanent 301 redirect for every HTTP page to redirect to the HTTPS counterpart. This way the search engines are notified that the site’s addresses have changed. Also, any bookmarks to a page on your site are automatically redirected to the https address.

Add all variants of the website site in Webmaster Tools: Add the HTTPS website as a new property in the webmaster tools account.

We have already discussed the first 2 steps in the article on How to Setup SSL. Now we will explain what you need to do once your SSL certificate is installed.

Update all internal and external links to HTTPS

General Websites

The first thing to do is to duplicate the content from the HTTP version to the location of the HTTPS version. In most cases, this can be done just by copying the content from the HTTP directory to the HTTPS directory on the same web server. Now we need to modify the HTTPS copy of the content using the following methods:

Canonicals: Update all the canonicals to absolute HTTPS URLs for the HTTPS version.

Internal Links: You need to update the internal links if the website does not use only relative internal links, including inside the Javascript and CSS files. If you use any custom or third-party scripts, update them to also point to the HTTPS versions. Look at the HTML source and find and update all internal links and references to internal links inside the assets. You can make the changes using the following options:

Note that doing this option may conflict with internal links to assets. This happens especially when the links are defined in CSS and/or Javascript files. You can also define a base tag URL in the HEAD of the HTML source code which would be appended to the relative URLs.

WordPress websites

In the case of WordPress websites, we need to follow these steps to update the internal and external links to HTTPS:

Update WordPress URLs: Use the dashboard settings to update these URLs:

Change all links to HTTPS: Use the following options to update all URLs to HTTPS:

Change the static URLs manually: Browse all the theme files and manually replace static occurrences of HTTP with HTTPS in theme files like header.php, footer.php etc.

Use the Find and Replace Plugin:The plugin will enable you to find all HTTP links in the WordPress Database and replace the occurrences with HTTPS.

Manually check the website’s pages: If you see the yellow padlock next to a URL, it means the page still loads with HTTP. Check if there is any HTTP link pointed to that page.

Set up 301 redirect HTTP to HTTPS:

It is essential to implement 301 redirects for HTTP pages to HTTPS to retain your search engine rankings and traffic. Google by itself will not update to index the new HTTPS website. Instead, you have to indicate that the URLs have changed. This has to be done through the use of 301 redirects.

Edit .htaccess file: If your website is running on an Apache server, add this snippet of code to your .htaccess file.

Note that we use the PHP server variable “HTTPS”. $_SERVER [‘HTTPS’] that returns “on” values to check if the site is already on SSL. If it is not already set then we update the header with the new location as per variable redirect_url.

The Redirection plugin manages 301 redirections and tracks 404 errors. It automatically adds a 301 redirection when the URL of a post changes.

The Yoast SEO Premium plugin has a built-in Redirect manager that helps you redirect HTTP to HTTPS URL for a post, page etc. The plugin also comes with a .htaccess editor that you can use for directly editing the .htaccess file.

The Quick Page/Post Redirect Plugin provides an option meta box on the edit screen. In this meta box, you can specify the redirect location and type (301, 302 or meta).

Add all variants of the website site in Google Console

Go to the Google Search Console (Webmaster tools) and add information about the update. You need to add the HTTPS website as a new property in your webmaster tools account. You also need to submit Sitemaps accordingly. Google also requires the proper implementation of 301 redirects on your website to understand your new site structure.

A minimum of four variations of the website domain name should be present in Google Search Console.

http://example.com

http://www.example.com

https://example.com

https://www.example.com

HTTP Strict Transparent Security (HSTS)

Web servers are in most cases not connected directly with each other. Requests and responses pass through a series of network routers before they reach the destination. The routers, therefore have full access to requests sent over HTTP connections. The data is transferred unencrypted, which can lead to potential man-in-the-middle attacks.

HTTP Strict Transport Security is a security feature that informs a browser that the website should only be communicated using HTTPS. The browser automatically converts all HTTP requests to the site to HTTPS requests instead. The HSTS policy forces that all responses should pass through HTTPS connections instead of HTTP. This ensures that the entire communication channel is encrypted before any data is transmitted. This makes it impossible to read or modify the data in transit.

HSTS can also be used to significantly improve the performance of the site by avoiding redirects. With HSTS the browsers are not allowed to ignore certificate errors and browse the website anyway.

The configurable parameters for HSTS are:

Enable HSTS (Strict-Transport-Security): On/Off.

Max Age (max-age): This is a “time to live” field for the HSTS header. Web browsers cache and enforce HSTS policy for the duration of this value. A value of “0” disables HSTS.

Apply HSTS Policy to subdomains (includeSubDomains): This field applies HSTS policy to every host in a domain.

Setting up HSTS is simple and can be easily accomplished. Let us see how it is done in Apache. Other web servers also provide this feature and you need to follow server specific steps to setup HSTS.

How to setup HSTS in minutes

After the website redirection to HTTPS is complete, then setting up HSTS is done by modifying the header. You need to add the Strict-Transport-Security HTTP header to the web server and also specify a length of time (max-age) for the policy to be enabled. In Apache this can be done with the following code:

The browser caches the HSTS settings for the duration of max-age. In the above code, the HSTS policy is enabled for 60 seconds. It is recommended to keep the max-age to low values during testing and initial go-live. You can increase this value, once you have verified that the website is working perfectly.

Challenges to Keep in Mind if You Redirect HTTP to HTTPS

It is of primary importance to prepare a plan when you decide to migrate to HTTPS. It is to be noted that challenges will be there that you need to overcome with careful planning. Some of the issues that people see when they set up HTTP to HTTPS redirection as follows:

Mistakes happen and details may be left out: Adding HTTPS redirection to an entire site to HTTPS requires moving many parts. You might take care but still, overlook important details. Follow a checklist and ensure you have covered everything.

Speed issues – Website may slow down: HTTPS requires extra communication between servers. This might result in slowing down the websites. However, if you follow best practices the site should not see a performance impact.

Costs: SSL certificates are costly and may range from $100-200 a year. That can be too expensive for small websites. However, these days there are free options e.g Let’s Encrypt, to move to HTTPS.

Not everything is ready for HTTPS: Not all applications may work with HTTPS. Older web applications may not be able to handle HTTPS URLs.

How to verify HTTPS complete migration

Once you have completed the HTTP to HTTPS migration you need to make sure that everything is covered. Some of your pages might remain with insecure elements and the websites may not show the proper security lock. There are online tools available that you can use to verify that the migration was complete. The Why No Padlock tool is an online tool that you can use to check if there are any insecure items on your website. You can promptly check if there are any insecure links found within a URL. The tool helps to identify insecure images, CSS and JavaScript and also insecure images that are linked into CSS and JavaScript. If your website is completely secure the tool would show a message “All items called securely” otherwise it would list the insecure elements.

Moving from HTTP to HTTPS: SEO considerations

We have already mentioned above that using HTTPS can improve the SEO rankings of your websites. Though a lightweight ranking signal at present, HTTPS will be an important ranking signal in the future.

There are some guidelines from Google regarding secure websites. There are SEO aspects that you need to take into account when planning how to redirect HTTP to HTTPS. This would certainly help you in maintaining the current rankings of your website.With the Google search engine, changes in

With the Google search engine, changes in a website are bound to result in either short term or long term ranking drop or fluctuation. The extent of this could vary from a few days to weeks or even months.

Rectifying these issues can take time, considering Google’s re-crawl and re-indexation rates. Take care to choose a quiet period when you bring your site up after the migration since it is certain that there will be fluctuations in search rankings
Let us look in detail at all these points for SEO considerations for HTTP to HTTPS redirection.

Common Issues and Pitfalls

These issues are seen if HTTPS migration in incomplete and you missed out on some critical points:

Google is not able to crawl the HTTP version of the site, or other site crawls in general.

Content duplication issues, as both HTTPS and HTTP versions of the pages, can be shown.

The difference in the versions of the page showing on HTTP and HTTPS.

Going with what Google says, you should not worry about switching from HTTP to HTTPS in terms of SEO. Google has been recommending HTTPS for years now. Google lists the below best practices when switching to HTTPS:

More importantly, it is up to you to ensure that your site traffic doesn’t suffer. You need to communicate to Google that your website has moved to redirect HTTP to HTTPS. You also need to follow the SEO checklist to preserve your rankings. This would help you to maximise site usability, search engine crawling, and indexing. Let us look at a few salient features from the SEO checklist.

Google Search Console: You should tell Google about the change to HTTPS. Filling out the official form makes the transition easier and helps ensure that you don’t lose your SEO rankings. To do this, you need to go to the Search Console or the Webmaster Tools and make the changes as described earlier in this article.

Submit a New Sitemap: You need to submit a sitemap for your new domain name with HTTPS.

First, create an XML sitemap and then submit that sitemap to the Google Search Console.

Update your robots.txt file: Add the new sitemaps to the file. Make sure your robots.txt does not block any important pages.

Resubmit Your Disavow File: Since you must create a new Google search console profile with the HTTPS URL, you need to resubmit the disavow file under the new profile. Otherwise, in case of an algorithm update, Google will not detect your disavow file.

Migrating social share counts: When migrating to HTTPS, you may want to preserve your social share counts that display in social share buttons. These counts probably don’t impact the SEO rankings, but they act as strong social proof. Look at this tutorial to understand how to alter your social buttons’ code to preserve the share counts.

Check the link-juice page ranking: It seems that setting up the 301 redirects would result in a certain percentage of PageRank getting lost through the redirect. Analyse the impact of 301s on your link-juice ranking and check how each search engine’s traffic is affected.

Monitor the Google Search Console for any issues: Keep a check on the Google Search Console for any indexing issues Google runs into. Check for index count, crawl errors, and search queries, etc. Make sure your new site is getting indexed and crawled correctly. Google has a full list of everything to check.

Redirect HTTP to HTTPS Checklist

After the HTTPS migration is done you need to check whether you have taken care of all essential points. Pick up an “HTTP to HTTPS checklist” or create your own with extra points specific to your websites. Follow the checklist as you work with the migration. In the end, go over the checklist and check if you have marked all the points completed. Summarising all that we discussed above is the below checklist you can use to redirect HTTP to HTTPS.

Start with a test server.

Crawl the current website.

Read any documentation regarding your server or CDN for HTTPS.

Get a security certificate and install on the server.Update references in content.

Update references in content.

Update references in templates.Update canonical tags.

Update canonical tags.

Update hreflang tags.

Update any plugins/modules/add-ons.

Change any CMS-specific settings that may need to be changed.Crawl the site to make sure nothing is broken.

Crawl the site to make sure nothing is broken.

Make sure any used external scripts support HTTPS.

Force HTTPS with redirects.

Update old redirects currently in use.

Crawl the old URLs for any broken redirects or any redirect chains.Update sitemaps to use HTTPS versions of the URLs.

Update sitemaps to use HTTPS versions of the URLs.

Update your robots.txt file to include your new sitemap.

Enable HSTS.Enable OCSP stapling.

Enable OCSP stapling.

Add HTTP/2 support.

Add the HTTPS version of your site to all the search engine versions of webmaster tools.

Update your disavow file.

Update your URL parameter settings.

Go live!

Update the default URL in your analytics platform.

Update your social share counts.Update all paid media, email or marketing automation campaigns with the HTTPS versions of the URLs.

Update all paid media, email or marketing automation campaigns with the HTTPS versions of the URLs.

Update any other tools such as A/B testing software, heat maps and keyword tracking to use the HTTPS versions of the URLs.

Monitor everything during the migration and check several times to make sure everything is working properly.

Creating secure websites with TemplateToaster

TemplateToaster is a WordPress Theme Builder responsible for developing websites across multiple CMS including Drupal, Joomla, Prestashop etc. Incorporating TemplateToaster in your workflow will give you a range of securely implemented themes to work with. These themes can be used to modify a website with security added or build a new secure website.

About Param Chahal

Param Chahal, the mind behind TemplateToaster have more than a decade of industry experience. He wishes to render his pool of wisdom on to the world by contributing with content ideas here on this blog through a team of dedicated editors and writers.