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!

Can I negate .htaccess for certain IP's?

Status
Not open for further replies.

roycrom

Programmer
Aug 2, 2002
184
GB
Hello,

I have a directory that is protected by .htaccess.

Is there a way that apache can allow access without authentication to this directory for a certain IP address but still ask for authorisation from everybody else (who is a valid-user)?

------------------------------------------
Somethings come from nothing, nothing seems to come from somethings - SFA - Guerilla

roycrom :)
 
I take it hat you mean out that in my .htaccess file.

If you did I did that.

My .htaccess is as follows
Code:
AuthUserFile /blah/.htpasswd
AuthType basic
AuthName "BLAH"
allow from "w.x.y.z"
require valid-user
satisfy any

my error log then said:

/BLAH/BLAH/.htaccess: allow not allowed here

Have you seen this before?

------------------------------------------
Somethings come from nothing, nothing seems to come from somethings - SFA - Guerilla

roycrom :)
 
This may be what your after...


1) Deny everyone access, then allow certain hosts/IP addresses

AuthName "MY Secret Area"
AuthType Basic
<Limit GET POST>
order deny,allow
deny from all
allow from 192.66.210.
allow from .tester.net
allow from bones.skell.net
</Limit>

2) Allow everyone except for certain hosts/IP addresses

AuthName &quot;MY Secret Area&quot;
AuthType Basic
<Limit GET POST>
order allow,deny
allow from all
deny from .aol.com
deny from .hackers.net
deny from 22.112.106.235
deny from chiller.bone.net
</Limit>


************************
 
This didn't work either but I've found another way around it using authorisation with php.

Thanks for your help tho guys :)

------------------------------------------
Somethings come from nothing, nothing seems to come from somethings - SFA - Guerilla

roycrom :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top