Keep it Secure – Enforce All Pages Over SSL

Recently I had a project that the client was using to collect user registration information, and we wanted to make sure that the information provided was done securely over SSL.  Rather than try to enforce this in the code, a simple change in the .htaccess file makes this easier to enforce.

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

Scroll to Top