Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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

share|improve this question
add comment

1 Answer

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.

share|improve this answer
1  
You say I need check CHMOD? –  marverix Oct 1 '12 at 19:06
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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