# let's force HTTPS RewriteEngine On RewriteCond %{HTTPS} off RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] # let's disallow txt files AuthType Basic AuthName "My text files are protected!" AuthUserFile /home/username/.htpasswd Require valid-user