How to force SSL (https) with .htaccess?

To force a browser to use an HTTPS connection on your website, add the following lines inside the website’s .htaccess file found in the public_html folder.

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


  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

What is the difference between shared SSL and private SSL?

We no longer offer a sharedSSL since Lets Encrypt free SSL certificates are now available.

How do I purchase a private SSL from you and what type is it?

while you can purchase other SSL certificates for your site from us, EthicalHost now offers free...

I'm going to purchase my own SSL: what do I need to know?

Our servers are Apache + Mod SSL. You will need to request us to generate a CSR (Certificate...