How to force SSL with .htaccess

When you have SSL enabled (supported by your host provider) it's a good practice to make sure the actual site is running on SSL Secured connection.

To do so, you can force an HTTPS (secured connection) on your website.

Step One

Login to your hosting, and in the Root folder, right click > edit the .htaccess file

 

Step Two

Add these rules in your website's .htaccess file:

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

The .htaccess file needs to be located inside the site's document root folder. If your website is in a sub folder, then the .htaccess should be placed in the corresponding sub folder.

To create or edit the .htaccess file, you can either access the root folder via FTP, or using with the File Manager available in cPanel.


What's .htaccess file?

Lear more about SSL Certificates

Contact us for SSL Certificates

 

Need further assistance?

Read more about SSL Certificates & Website Security. We offer custom solutions per needs.

0/5 (0 Reviews)

Leave a Reply

Your email address will not be published. Required fields are marked *