0

I need to protect my HTML-page (admin.html) with password and I'm using .htpasswd + .htaccess files

As far as I understand, there is no need to write htmk containing flder in tag. But I've set full path to .htpasswd! So why do I get 500 error with this .htaccess - file?

<Files "admin.html"> AuthName "Username and password required" AuthUserFile D:\Program Files (x86)\xampp\htdocs\news_back\client\.htpasswd Require valid-user AuthType Basic </Files>

both files (admin.html and .htpasswd) are in "client" folder. (Yes, I've tried <Files "client/admin.html">)

Content of .htpasswd: admin:$apr1$7n2mqwOp$INTz7H7lnL8dZVXlxcIu31

My op. system is Windows 7, I run XAMPP(with Apache/2.4.12 (Win32) OpenSSL/1.0.1l PHP/5.5.24) locally.

Alex Sham
  • 489
  • 7
  • 14

1 Answers1

2

Just guessing here, I have very little experience in MS-Windows based systems. But these typical back slashes spring into the eye. Could it be that you have to escape them? Because on every sane system the back slash has a special meaning that might cause problems. Same with the space character, the colon (:) and the brackets ((,)).

Have a try putting the file to a location with less risky naming. Just as a test. Does that work?

arkascha
  • 41,620
  • 7
  • 58
  • 90
  • Thank you for advice! Something strange with path(maybe spaces here...) I've put my .htpasswd file into D; and that helped! So form your advice as an answer here and I'll mark it as correct. – Alex Sham Jul 11 '15 at 18:33