Skip to content


Internal server error (500) when setting up htaccess password protection

“500 – Internal Server Error” is one of those annoying error messages that are so useless at finding out what’s wrong. I’d been following this guide to quickly password-protect a site section using Apache and .htaccess directives (you know, “Require valid-user” and such), and then came this error.
My .htaccess file looked like this:

AuthUserFile /home/somepath/.htpasword
AuthType Basic
AuthName “Private area”
Require valid-user

After commenting out each line one by one, it seemed at first that the error appeared on “Require valid-user”. But as pointed out in this post, just because the error appears when you add this line doesn’t mean it’s the culprit. And in my case, the problem was actually on the first line: there was a typo in the password file name. That’s really tricky because despite the typo, the site did ask me for user and password (so it seemed as if this was working properly)…
So, when you get that error and manage to figure out which lines triggers it, do analyze all the lines that work together with the triggering line!

Posted in web development.


One Response

Stay in touch with the conversation, subscribe to the RSS feed for comments on this post.

  1. Alex.29a says

    Thanks for the information, had a httaccess hidden in my folder manager and gave me internal server error;)

    Greetings from Spain



Some HTML is OK

or, reply to this post via trackback.

Please solve the CAPTCHA below in order to fight spamWordPress CAPTCHA