Force SSL / HTTPS or Non-SSL On Your Website

  Print

How to force the SSL / HTTPS or Non-SSL version of your website

Click here for a quick guide on finding and editing your .htaccess file

To force visitors to your website to go to the SSL (https) page, add this code to the top of your .htaccess file

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

To force visitors to your site to use the non-SSL (http) page, use this code in the top of your .htaccess file:

RewriteEngine On
RewriteCond %{HTTPS} on
RewriteRule ^ http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]


Thank you for your feedback on this article.

Related Articles

© Crucial