RewriteEngine On RewriteCond %{HTTPS} !on RewriteCond %{REMOTE_ADDR} !^127\.0\.0\.1$ RewriteRule .* https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L,QSA]