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