SSL Redirect BEFORE Basic Auth Using mod_rewrite

Hiya,

Hoping someone has run into this problem before and can help me solve it. I want to use mod_rewrite and an .htaccess file to force users to use 443 SSL connection, PLUS I want to authenticate using basic auth.

However, the rewrite always does 80 http auth first, then does it again for SSL. Is there a way to force the engine to do the rewrite first, then the authentication??

Code:
Options +FollowSymlinks
RewriteEngine On
RewriteCond   %{SERVER_PORT}  !^443$
RewriteRule (.*)$ https://URL/DIR/$1 [L,R]
AuthType Basic
AuthName "Restricted Area"
AuthUserFile /home/ACCTNAME/.htpasswds/restricted/passwd
require valid-user
first makes the user enter name/pass for http; then makes them enter it again for ssl. Any suggestions?

 

 

 

 

Top