red house 87
red house 87

Reputation: 2415

.htpasswd not working - maybe because of reference

I have a server which i'm trying to setup a password on via .htaccess and .htpasswd. Here is my server document structure:

enter image description here

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

Answers (1)

red house 87
red house 87

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

Related Questions