How to Redirect a Website from HTTP to HTTPS using .htaccess?

How to Redirect a Website from HTTP to HTTPS using .htaccess?

Bazasoft includes a free SSL Certificate (HTTPS) for all Hosting Plans. The certificate is available in your cPanel and you can activate it anytime. Login to cPanel and go to the files manager where you can find .htaccess file. To force all web traffic to use HTTPS, insert the following lines of code in the […]

Knowledgebase: Web Hosting

How to Redirect a Website from HTTP to HTTPS using .htaccess?

Bazasoft includes a free SSL Certificate (HTTPS) for all Hosting Plans. The certificate is available in your cPanel and you can activate it anytime. Login to cPanel and go to the files manager where you can find .htaccess file. To force all web traffic to use HTTPS, insert the following lines of code in the .htaccess file in your website’s root folder.

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

Chrome Browser, as well as Firefox, have started showing some insecure warnings on websites without SSL certificates. Without HTTPS, your website will be shown as insecure to the visitors. Therefore, using an SSL-encrypted connection for safety, accessibility and PCI compliance reasons is necessary. It is important to redirect your site from HTTP to HTTPS.

Share:
Need a 300GB SSD-Boosted VPS at $6.49
A 4GB guaranteed RAM with 300 GB SSD-Boosted Space + UNLIMITED Bandwidth