Reputation: 2415
I have a server which i'm trying to setup a password on via .htaccess and .htpasswd. Here is my server document structure:
The only path it shows higher than var is "/" which i'm assuming means root. Both my .htaccess and .htpasswd live in the dashboard folder you can see highlighted in the photo above. Here is the code for each:
.htaccess:
AuthType Basic
AuthName "restricted area"
AuthUserFile /var/www/html/dashboard/.htpasswd
require valid-user
RewriteEngine On
RewriteRule ^([^/d]+)/?$ index.html?id=$1 [QSA]
.htpasswd:
testing123:testing123
My best guess is that the path for AuthUserFile
is wrong and it's not finding my password file but not sure if anyone can spot why it's wrong or if it's something else?
Upvotes: 0
Views: 2677
Reputation: 2415
Turns out I have to encrypt my password in the .htpasswd file. I used this tool here:
https://davidwalsh.name/web-development-tools
Upvotes: 2