http://mydomain.com/myfolder http://www.mydomain.com/myfolder https://www.mydomain.com/myfolder (the above 3 should all be redirected to https://mydomain.com/myfolder)Without the rewriterule, all 4 urls are accessible as is (and ask for username & password).
Here is my htaccess file so far, but what it appears to do is always ask for the username and password first and then redirect second. I want it to redirect first and then ask for username and password, so that you cannot enter your username & password with regular http but have to use https.
RewriteEngine On RewriteCond %{SERVER_PORT} 80 RewriteCond %{REQUEST_URI} myfolder RewriteRule ^(.*)$ https://mydomain.com/myfolder/$1 [R,L] AuthType Basic AuthName "AUTHORIZED ACCESS ONLY" AuthUserFile "/home/mydomain/.htpasswds/public_html/myfolder/passwd" require valid-user Thanks --------------------------------------------------------------------- The official User-To-User support forum of the Apache HTTP Server Project. See <URL:http://httpd.apache.org/userslist.html> for more info. To unsubscribe, e-mail: users-unsubscribe@xxxxxxxxxxxxxxxx " from the digest: users-digest-unsubscribe@xxxxxxxxxxxxxxxx For additional commands, e-mail: users-help@xxxxxxxxxxxxxxxx