[Solved] Htaccess password protection

Hey guys,

I’m trying to protect my invoice page with a .htaccess password. Unfortunately I always get a 500 internal server error. I tried different passwords, e.g. without special characters, but that didn’t help.

This is the code of my htaccess file:

# Remove index.php
RewriteEngine on
RewriteBase /invoice
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule . index.php [L]
Redirect /setup http://myurl.com/invoice/

AuthType Basic
AuthName "Password Protected Area"
AuthUserFile /path/to/my/.htpasswd
Require valid-user

Any ideas appreciated! :beers:

(I followed the instructions on this page and also used their generator)

I don’t have a solid solution, but I would suggest you try to password protect any other directory on the server with plain html files in it, just to make sure the error 500 is not related to InvoicePlane. If that too is throwing the same error, then it’s not a problem with InvoicePlane.

Last but not least… Is the /path/to/my/.htpasswd correct (based on server root) ? Does the process of the web server have access to this file (permissions) ?

1 Like

Thanks for the quick reply. Indeed the path was not pointing to the server root.
Works now! Thanks!

This topic was automatically closed after 24 hours. New replies are no longer allowed.