Migration of http to https in Cpanel

Migration of HTTP to HTTPS in cPanel

A website request form without secure:

HTTP is Hyper Text Transfer protocol that is used in networking. Whenever basically you type a website in the browser. By default website loading from normal 80 port with http:// request.

Whenever a request is initiated by the client to server, an underlying TCP handshake is done from client to server side. Once the handshake is completed then HTTP protocol starts sending requests and server fulfills the request based on the data available with it.

A website request form with secure:

HTTPS is Hyper Text Transfer protocol secure that is used in networking. Whenever basically you type a domain name in the browser. By default website loading from normal 443 port with https:// request.

This is Hypertext Transfer protocol with added security layer in place in the form on TLS/SSL. Servers and clients communicate with each other exactly the same as HTTP but over a secure channel.

  1. It is confirmed after using HTTPS that you are talking to the server directly that you are thinking of.
  2. It also ensures that only the server reads the data you sent over the network. No else can read it.
  3. And also your secret data transfer with encrypted form.

With HTTPS How the SEO ranking gets improved:

There is a significant improvement in website SEO ranking because of HTTPS. Google has officially indicated that HTTPS is a ranking signal. They actually encourage sites to adopt HTTPS. Because it improves SEO rankings, websites using HTTPS are more likely to show up in organic search results. HTTPS helps search engines recognize your site as secure, which positively affects your site's ranking.

How to redirect HTTP to HTTPS Codebase?

Below you can find couple of ways through which you can redirect your website from HTTP to HTTPS:

1. From database change: (For WordPress Environment)

You can update your site URL in WordPress database to HTTPS from HTTP by running the following SQL commands:

UPDATE wp_options SET option_value = replace(option_value, 'http://www.example.com', 'http://example.com') WHERE option_name = 'home' OR option_name = 'siteurl';

UPDATE wp_posts SET post_content = replace(post_content, 'http://www.example.com', 'http://example.com');

UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://www.example.com','http://example.com');

2. From the WordPress Plugin redirect to HTTP to HTTPS:

First, you need to install and activate the Really Simple SSL.

Upon activation, you need to visit the Settings » SSL page. The plugin will automatically detect your SSL certificate, and it will set up your WordPress site to use HTTPs.

You can activate that settings.

3. From htaccess file (For all websites):

You can redirect your website from HTTP to HTTPS by making changes in your .htaccess file as follows:

<IfModule mod_rewrite.c>
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example.com [NC,OR]
RewriteCond %{HTTP_HOST} ^www.example.com [NC]
RewriteRule ^(.*)$ https://www.example.com/$1 [L,R=301,NC]
</IfModule>

This will ensure that all HTTP requests are redirected to HTTPS version of your site.