tags:

views:

46

answers:

2

I used .htaccess and .htpasswd to restrict the admin folder which is located at root/admin

for that i used the following

.htaccess file

AuthName "Alertalert"
AuthType Basic
AuthUserFile http://alertalert.freetzi.com/admin/.htpasswd
require valid-user

.htpasswd file

rajasekar:$apr1$0yd92n1r$McIxIiQXPRF1u3gRBNRNc1

the .htaccess and .htpasswd file is located inside the admin folder.

When i try to access admin folder, it asks for username and password and thats ok. if I give correct username and password, its not accepting and so prompting again.

Please help me..

+1  A: 

do you have any code in .htacess that prevents viewing of .htpasswd? Because you are going though HTTP, it may not be accessible. What about using the system path?

What about something like: AuthUserFile /var/admin/.htpasswd

easement
when i use it in local system using absolute path like c:/xampp/htdocs/admin/.htpasswd its working. but when i host it, its not working
Rajasekar
its working now
Rajasekar
+4  A: 

Check the documentation for the AuthUserFile directive. Its argument should be the path to the htpasswd file, not a URL.

David