0

Well, I'm trying to secure my xampp with .htaccess and .htpasswd and I don't see a mistake, so do many other developers that I know...

My .htaccess:

AuthName "Protected Area"
AuthType Basic
AuthUserFile C:/xampp/secret/hidden/place/.htpasswd
require valid-user
php_flag register_globals on

My .htpasswd:

wscript:$apr1$Y107OG1n$Ui6D997SqhERXXyV9VBU51

The error is error 500

Anyone?

LisaW
  • 171
  • 2
  • 3
  • 11

1 Answers1

1

You should consult your error logfile usually located at: /var/log/apache2/error.log. Without knowing the exact error there's really only speculation as to what might be the issue.

AuthName "Protected Area"
AuthType Basic
AuthUserFile C:/xampp/apache/var/www/site/.htpasswd
Require valid-user
  • require valid-user should be capital "R"
  • AuthUserFile is usually located one directory above the web root.
  • The permissions on the .htaccess and .htpasswd need to be set so that Apache can read them: chmod 0644 .htaccess chmod 0644 .htpasswd

( further reading )

l'L'l
  • 44,951
  • 10
  • 95
  • 146