-1

i can get the .htpasswd to work with .htaccess

I have the following lines in htacess

<Files ".htaccess">
order allow,deny
deny from all
</Files>
AuthUserFile /var/www/example/.htpasswd
AuthName "Restricted Area"
AuthType Basic
Require valid-user  

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f

RewriteRule ^(.+)$ /index.php/$1



and htpasswd look as it follows

user:passw
<Files ".htpasswd">
order allow,deny
deny from all
</Files>

I'm trying to log in but without success apache error.log tells "/": Password Mismatch but I have been checking couple of times everything is okay with it.

lgt
  • 1,024
  • 3
  • 18
  • 33
  • You can find the answer here. http://stackoverflow.com/questions/5229656/password-protecting-a-directory-and-all-of-its-subfolders-using-htaccess/43831765#43831765 – Deepak R May 13 '17 at 18:26

2 Answers2

0

password are manipulated using htpasswd utility

see: http://linux.die.net/man/1/htpasswd

Your case can be:

htpasswd -c /var/www/example/.htpasswd user
john
  • 51
  • 1
0

Try and generate passwords using the site: htpasswd-generator and also put the file outside the web root directory of the site not inside it.

nikunj
  • 402
  • 5
  • 9