Redirect HTTP to HTTPS Using .htaccess

SSL (Secure Sockets Layer) Certificates is a standard security protocol for establishing encrypted links between a web server and a browser.

It activates the padlock and the https protocol and allows secure connections from a web server to a browser.

Steps to redirect HTTP to HTTPS code in .htacces file

Step 1:   Login in Your Cpanel.

Step 2:   File Manager

Step 3:   public_html

Step 4:   Search ".htaccess" file, if it is not showing then check for the Show hidden files

Step 5:   Edit ".htaccess" file, add the code

Step 6:   Add the following code to the page:


RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301,NE]


  26th-February-2020

  Adarsh Vishwakarma



Leave a Comment



All Rights are Reserved