Knowledge Base

How to force SSL & HTTPs with .htaccess on your site

Now that HTTPs is a major requirement, you will need to enforce this on your site. You can force SSL or HTTPs very easily via the file .htaccess.

To force SSL, you will need to make sure Mod_Rewrite is enabled on your server. Edit your .htaccess file and add the code below.

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

Was this helpful? Yes No

Still have questions?

If you still have questions, feel free to open a ticket and we will gladly help you out!

Open a ticket