[Tfug] Brain fart... htaccess restrict by IP and Password

Sam Hart hart at physics.arizona.edu
Fri Jul 2 12:48:40 MST 2004


Yep, Satisfy was what I was forgetting. Thanks all ;-)

* On 04-07-02, Robert Zeigler wrote:

> Sam Hart wrote:
> > Okay, I'm having a bad day and can't think straight...
> > 
> > I know it can be done, I've even done it before, but for the life of me I 
> > can't remember how..
> > 
> > I need to restrict a web directory by IP address range and password 
> > protect it otherwise.
> > 
> > I.e., If you are in IP range, you automatically get in. If you are not in 
> > IP range, then you must enter a password to get in.
> > 
> > I know this can be done with .htaccess, and I can do either/or, but I 
> > can't remember how to combine the two.
> > 
> 
> Check out the following, particularly the very end of the document, 
> under "Satisfy"
> http://httpd.apache.org/docs/howto/auth.html
> 
> This is the example given in the above document, which seems to be 
> exactly what you're looking for. It allows everyone from "internal.com" 
> to access the files, and otherwise requires a password.
> 
> <Directory /usr/local/apache/htdocs/sekrit>
>    AuthType Basic
>    AuthName intranet
>    AuthUserFile /www/passwd/users
>    AuthGroupFile /www/passwd/groups
>    Require group customers
>    Order allow,deny
>    Allow from internal.com
>    Satisfy any
> </Directory>
> 
> Robert
> _______________________________________________
> tfug mailing list
> tfug at tfug.org
> https://www.tfug.org/mailman/listinfo/tfug
> 

-- 
Sam Hart
University/Work addr. <hart at physics.arizona.edu>
Personal addr. <sam at samhart.net>
end



More information about the tfug mailing list