How force my domain to use HTTPS (for any site)?

Capitan Hosting

Add the following code to your .htaccess file and make sure to change ‘example.com’ to your actual domain name:

 

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

Table of Contents
Back to top