RewriteEngine on RewriteCond %{HTTP:X-Proto} !SSL RewriteRule ^(.*) https://%{HTTP_HOST}%{REQUEST_URI} [L]