Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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} ^ [OR]
RewriteCond %{REMOTE_ADDR} ^
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.

share|improve this question
up vote 9 down vote accepted

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

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

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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