i want to use for some website Apache password protection for an directory. This is not mine hosting so I can't look to logs or sth. So I just copied my .htacces that works just perfect on my hosting. The problem is, that I don't see any dialog box asking for login and password... Nothing... Just Blank page! Even index file doesn't work. When I have deleted .htaccess - index.php works just fine.

If it will help: I'm trying to secure subdirectory. In main directory I also have .htaccess (for mod_rewrite). In main directory everything is OK.

Here is code of .htaccess which should secure subdirectory.

AddDefaultCharset UTF-8

ErrorDoc 401 "Sorry, this is top secret zone"

AuthName "Top secret" 
AuthType Basic
AuthUserFile .htpasswd 
AuthGroupFile /dev/null 
require valid-user

Any ideas?

P.S. Ofcourse .htpasswd is in the same directory like .htaccess

1 Answer 1


You should check the permissions on the .htaccss and .htpasswd files and make sure they are readable by Apache. It looks like the "require valid-user" should be "Require valid-user".

Without error messages or output in a log file it is hard to debug.

  • 1
    You say I need check CHMOD?
    – marverix
    Oct 1, 2012 at 19:06

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.