RewriteEngine On RewriteCond %{HTTP:HTTPS} !on RewriteRule (.*) https://%{SERVER_NAME}/$1 [QSA,L,R=301]