Forum Moderators: phranque

Message Too Old, No Replies

allow by IP *and* require username/pass?

Can you combine these two .htaccess functions?

         

Babak

9:52 pm on Apr 23, 2006 (gmt 0)

10+ Year Member



Hi everyone, this is my first post. I'm so glad I found these awsome forums.

ok, I'd really appreciate it if someone would help me with this. I'm trying to restrict access to a domain and I would like to do it, if possible this way:

by known IP addresses
AND by requiring username/password

That is two conditions have to be met, a person from a certain IP comes to my site AND they have to enter a username and password.

There are descriptions of each SEPARATE functions but I'd like to know if there is a way to require *both* from someone before they can view the contents.

I'm not paranoid btw, just curious if this can be done and if so, how.

Please know that I'm a total noobie so when explaining don't assume I know anything ;o)

Thanks very much in advance.

jdMorgan

4:02 am on Apr 24, 2006 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



If you allow only certain IP addresses using mod_access (Allow.Deny) and you also require a password, then the default behaviour of Apache would be to require both.

If you want to allow users from speccific IPs to access the site without a password, then see the Apache core "Satisfy any" directive. But the *and* behaviour (Satisfy all) is the default setting.

Jim