I am attempting to add HTTP authentication to my php-based Heroku app. I found a great Github gist here that provides code for creating .htaccess and .htpasswd files in my Heroku directory. I currently have both files within the /app/ directory (so .htaccess is located at /app/.htaccess and .htpasswd is located at /app/.htpasswd). However, when I navigate to my app and enter in the username and password, I get a 500 internal server error. Checking the Heroku logfile, I can see only that my .htpasswd file was not found:
(2)No such file or directory: [IP removed] AH01620: Could not open password file: /app/.htpasswd
Here is the full contents of my .htaccess file:
AuthUserFile /app/.htpasswd AuthType Basic AuthName "My Files" Require valid-user
If I run bash on heroku and 'ls -a', I can see that my .htpasswd file is definitely in the /app/ directory.
Someone has any idea what is going on here? Is there something that I'm missing in terms of getting this set up?