RewriteEngine On
RewriteBase /

RewriteCond %{HTTP:SSL} !=1 [NC]
RewriteCond %{HTTPS} off [NC]
RewriteCond %{HTTP:X-Forwarded-Proto} !https
RewriteRule ^(.*)$ https://%{HTTP_HOST}/$1 [R=301,L]




#Protect Directory
AuthName "Dialog prompt"
AuthType Basic
AuthUserFile /var/www/html/.htpasswd
Require valid-user
