I have a development site that, for an additional layer of protection to keep preying eyes away, I have behind a htpasswd file. However, I'm getting tired of typing in the username and password when I'm running test on the server. So I thought it would be cool if I could check to see if the REMOTE_ADDR = the Server's IP, to skip those lines in the htaccess file by doing the following

RewriteEngine on

RewriteCond %{REMOTE_ADDR} ^127.0.0.1 [OR]
RewriteCond %{REMOTE_ADDR} ^192.168.1.25
RewriteRule ^(.*)$ - [S=5]

AuthName "Protected Folder"
AuthType Basic
AuthUserFile /var/www/html/develSite/.htpasswd
Require valid-user

however, it is not skipping over the lines and thus prompting me still. I was hoping someone might lead me to what is missing.

link|improve this question

feedback

1 Answer

up vote 6 down vote accepted

Insted of mod_rewrite, you need to use the Satisfy directive:

Require valid-user
Allow from 127.0.0.1, 192.168.1.25
Satisfy Any
link|improve this answer
1  
works with one minor correction; ips needed to be seperated by a space not a comma. thanks – Scott Sep 24 '09 at 17:48
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.