Knowledge and Concepts of Digital Marketing & Management

How to Do Http to Https Redirection?

What is HTTP?

Http is meant for HyperText Transfer Protocol is a base of the World Wide Web (WWW). It is used to load the pages through hypertext links.

In simple words, HTTP is an application layer protocol to send data between network devices and run on the top of the other protocol layers.

I won’t want to make this article typical for anyone, thus would like to make it as simple as anybody can understand it easily.

Each HTTP request carries a series of encoded data that contains many type of information.

Why is HTTP not secure?

When a website runs on a plain http platform, its transfers the data insecurely, means the data transferred through plain HTTP request is not encrypted, which means the data transfer is not secure and anyone can look for the data on the network and can also modify the data.


What is Encryption?

When we use the secure connection HTTPS protocol or using a SSL(Secured Socket layer) certificate on our website, then its encrypts the data into complicated codes while on transfer from user request to server and back server to a user.

This complicated code, prevents the information from unauthorised access and makes the environment secure on the internet to avoid any unauthorized activity.

What is HTTP to HTTPS redirection:

Google loves secured connections and it is also a major ranking factor nowadays considering to offer a secured and safe website to users.

Recently we have also written on reCAPCHA which is a Google tool to stop spamming activity on your website.

As Google says the reCAPTCHA is free for everyone, but we encountered that the reCAPTCHA was not working on the non-secured website which was running on HTTP and once we push it on HTTPS, reCAPTCHA starts working on that website.

So I just want to tell you that a secured connection will always be considered by Google on SERP as well as if your website is offering payment transactions or you are running a eCommerce website then this is very essential for you to secure your website from SSL certification.

How to do HTTP to HTTPS redirection by .htaccess file?


.htaccess file is available with your hosting provider, you can edit the .htaccess file in the file manager by login to your cPanel.

cPanel login credentials will be provided by your hosting provider.

Just simply copy and paste the below code to your .htaccess file

<IfModule mod_rewrite.c>

RewriteEngine On

RewriteCond %{HTTPS} off

RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]


If your server is on nginx then you need to add the following code to redirect from HTTP to HTTPS in the configuration file.

server {

listen 80;


return 301$request_uri;


Kindly make sure to replace with your domain name in the code.

Once you are done with this, you are all set, your domain will now run on https secured layer.

Now submit your site to Google Search Console:

It is very important to index your https version to your Google search console as Google considers the HTTP and HTTPS as two different websites

Once you add the HTTPS version property to the search console, you all set to fetch the data to your website’s HTTPS version.

Manish Mishra

Add comment

Drag View Close play

Follow us

Follow us here and find the latest updates here