Trying to secure a folder with .htaccess First I want all requests to that folder to redirect to https then to ask the user for a password.
My .htaccess file that's in the root of the protected folder looks like this
RewriteEngine On
RewriteCond %{HTTPS} off
RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
AuthUserFile "/etc/somewhere/.htpasswd"
AuthType Basic
AuthName "Protected"
require valid-user
I get asked for a password - but the https redirection does not work So if I try www.domain.com/folder the auth box comes up with user/pass request but it stays in http... I want it to first go into https mode then ask for a password.
Ay reason why this is not working ?