Forum Moderators: phranque
I used this htaccess..
This htaccess works perfectly to my localhost but when i use this same htaccess another server where i have to place it, is not working(I mean, From allow ip also, it asks username and password)
AuthUserFile /Applications/MAMP/htdocs/test/.htpasswd
AuthType Basic
AuthName "test"
<LIMIT GET POST>
require valid-user
order deny,allow
deny from all
allow from 222.123.1.255
allow from 222.123.1.207
allow from 222.123.1.208
Satisfy Any
</LIMIT>
It/s an urgent...
Thank you all for your kind help
Samu
If this code works on one server, but not another, the problem is likely that AllowOverride is configured differently on the two servers. You'll need to contact the host (where the code does not work) and ask them to change the server config to allow use of these directives. If they won't change it for you, then you'll need to change hosts.
Jim
- Just Found a main Problem..
a.) From the server where i have to place the htaccess, From there it's working(authenticate correctly) as I browse by placing ip
eg http://125.***.1.201/myfolder/
while browse this way, it does work correctly. trust the allowed ip and require no password but rest require user name and password.
b.) But If Browse by(this is actually redirect url of 125.***.1.201) http://npl.example.com/myfolder/ then this does not trust the allowed ip from htaccess. It asks password and username.
c.) I have checked my Apache
Apache Version Apache/1.3.33 PHP/5.2.1
Hostname:Port npl.example.com:80
HTTP_HOST 125.***.1.201
REDIRECT_SCRIPT_URI http://npl.example.com
SERVER_ADDR 125.***.1.201
SERVER_NAME npl.example.com
SERVER_PORT 80
d.) So I can browse by both way, but for public, I need to use url http://npl.example.com/myfolder/
Your kind help would be greatly appreciated.
Hoping to get solution
Samu
[edited by: jdMorgan at 2:37 pm (utc) on Mar. 12, 2008]
[edit reason] Obscured specifics per TOS -- and for your security. [/edit]