3

I've created a .htaccess and a .htpasswd file, both using my hosting's tool, uploaded them, and I get an error when I try to view the directory. Why?

my .htaccess file:

AuthName "Restricted Area" 
AuthType Basic 
AuthUserFile /home/u947248131/.htpasswd 
AuthGroupFile /dev/null 
require valid-user
1

in your .htaccess file is it within

 <Directory /path/to/the/directory >
AuthName "Restricted Area" 
AuthType Basic 
AuthUserFile /home/u947248131/.htpasswd 
AuthGroupFile /dev/null 
require valid-user
</Directory>

More help http://httpd.apache.org/docs/2.2/howto/auth.html#gettingitworking

Otherwise if you can put the error log that would help

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.