“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:
AuthName “Private area”
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!