views:

28

answers:

2

I have set up a site that is currently work in progress. I'm using an external SMS gateway that needs access to a script on my server. However, I have set up a basic username and password authentication for regular users, but the SMS gateway can't get through that.

How can I allow a single IP to pass through the authentication without authenticating itself, and deny all other users that aren't authenticated?

Here's my .htaccess file:

Order allow,deny
Allow from all
AuthType Basic
AuthUserFile /www/.site_htpasswd
AuthName "Protected Area"
require user admin
+1  A: 

Try changing first 2 lines to

Order deny,allow
Deny from all
Allow from 1.2.3.x

Replace your desired IP in the Allow from

JoseK
This just gives me an 403 Forbidden :/
rebellion
Never mind that, I had an error.. :P BUT, now it just keeps asking me for authentication, and don't want to authenticate me when I enter my credentials.
rebellion
A: 

Just found out, with help from JoseK:

Order deny,allow
Deny from all
AuthType Basic
AuthUserFile /www/.site_htpasswd
AuthName "Protected Area"
require valid-user
Allow from 1.2.3.4
Satisfy Any
rebellion