tags:

views:

27

answers:

2

Is there a way to require the use of htpasswd if the user is not in a certain IP range?

EDIT:

K I have this right now

Order Deny,Allow
Deny from all
AuthName "Htacess"
AuthUserFile /var/www/Test/.htpasswd
AuthType Basic
Require valid-user
Allow from 111.111.111.111
Satisfy Any

But its giving me a 500 error

A: 

You can restrict access by an IP range using .htaccess. You can combine this with users of an .htpasswd for additional security.

Take a look at this tutorial outlining both. Although separate, you can use them together in the same .htaccess file.

Jason McCreary
yeah, i know how to use both of them, i just dont know how to join them
Ascherer
A: 

Figured it out

AuthName "Htaccess"
AuthUserFile /var/www/test/.htpasswd
AuthType Basic
Satisfy Any
<Limit GET POST>
    Order Deny,Allow
    Deny from all
    Allow from 111.111.111.111
    Require valid-user
</Limit>
Ascherer