Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

.htaccess - allow access via an ip OR uid/pwd

Status
Not open for further replies.

cleaner416

Programmer
Feb 5, 2002
42
US
Greetings,

I am running Apache 2.0 and would like to create an .htaccess file that allows access from an internal IP and for everyone else requires a password. In psuedo code, my .htaccess file would like something like this:

if 10.0.0.
allow
else
authenticate against .htpasswd

Is this possible?

Thanks in advance!


 
Sure. This [tt].htaccess[/tt] should work:
[tt]Satisfy any
Order allow,deny
Allow from 192.168.1.
Deny from all
# Authentication
AuthType Basic
AuthRealm "La la la"
AuthUserFile /path/to/.htpasswd[/tt]

//Daniel
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top