0

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?

red house 87
  • 1,837
  • 9
  • 50
  • 99

1 Answers1

2

Turns out I have to encrypt my password in the .htpasswd file. I used this tool here:

https://davidwalsh.name/web-development-tools

red house 87
  • 1,837
  • 9
  • 50
  • 99
  • Yes you do ! I was unaware that you hadn't done that. Just figured you where using the above as an example. Always encrypt your passwords. – Joe Aug 24 '17 at 14:02