RewriteEngine On # Require HTTPS **always** RewriteCond %{HTTPS} off [OR] RewriteCond %{HTTP:X-Forwarded-SSL} off RewriteCond %{HTTP:X-Forwarded-Proto} !https RewriteRule ^(.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]