RewriteEngine On RewriteBase / ## SSL # Enforce SSL RewriteCond %{SERVER_PORT} !^443$ RewriteRule (.*) https://%{SERVER_NAME}%{REQUEST} ## Basic Auth protection AuthType Basic AuthName "secured area" AuthUserFile /path/to/.htpasswd require valid-user