The first thing you need to switch to the https protocol is an SSL certificate. It can be purchased and generated for free through special websites. The choice of certificate depends on the level of your site. For example, EV certificates have the highest value. They provide a reflection of the green padlock next to the address and company name. After receiving the SSL certificate, you can proceed to working with the site.

Step 1 – resource preparation

What to do in this step:

  • replace all internal links with relative ones to the protocol. For example, //site.com/main/ instead of http://site.com/main/;
  • check all downloaded code for the presence of the appropriate protocol in the address. When you switch to https, it may become unavailable. This is especially critical when loading libraries from a CDN that ensure the site is displayed correctly. The same applies to all counters, metrics and other data collection tools connected externally;
  • make the addresses of all downloaded media files relative.

The link in rel=”canonical” must be relative. Make sure of this for normal site indexing.

Step 2 – connecting an SSL certificate

The purchased set of files must be installed on the hosting. Most providers have this option in their control panel. If this cannot be done, contact hosting support.

Once this step is completed, open the site via http and via https. Make sure everything is functioning properly. Check that the SSL certificate configurations are correct. This can be done through one of the special services or websites.

Step 3 – setting up the resource

At this stage, it is necessary to carry out a number of manipulations so that the resource functions correctly using only one protocol. We perform 4 actions:
  • setting up a redirect from http to https. This requires 2 lines of code in the .htaccess file:

RewriteCond %{SERVER_PORT} !^443$

RewriteRule ^(.*)$ https://site.by/$1 [R=301,L]

  • Nastraivaem robots.txt. In the address, change the Host protocol http to https (or add https:// before the domain name). This is necessary for the site to be indexed using one protocol;
  • Setting up sitemap.xml. When using a map for search robots, you must replace all addresses with new ones indicating the https protocol;
  • We check the work of the preparatory stage - links, metrics, scripts, media files.

Step 4 – notify search engines

So as not to wait for the usual site indexing to new addresses, just perform a few steps in the settings of webmaster panels. This will speed up the return of the resource to its previous positions. Thanks to the use of a secure protocol, positions in search results can increase.

In the places where the old address was indicated, insert a new one with the https protocol. It is necessary to configure the merging of different addresses so that traffic goes only to the main one.

There are 4 options:

  • http://site.com/main/
  • https://site.com/main/ (may be the main one)
  • http://www.site.com/main/
  • https://www.site.com/main/ (may be the main one).

Additional tasks

You must specify the new address in social media metrics. This will help you regain your position faster. If possible, you should replace external links with new ones with a secure protocol.

If for some reason the previous positions of the resource have not been returned, and instead of a green padlock in the address bar there is an exclamation mark, an error has occurred. It is necessary to repeat everything again and eliminate it.