Reputation: 18938
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.
Upvotes: 0
Views: 1068
Reputation: 3113
Check the documentation for the AuthUserFile directive. Its argument should be the path to the htpasswd file, not a URL.
Upvotes: 4
Reputation: 6139
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
Upvotes: 1