I have a .htaccess that uses basic authentication. It seems the path to the .htpasswd file isn\'t relative to the htaccess file, but instead to the server config.
So eve
.htpasswd requires full absolute path from the absolute root of the server.
Please get full absolute path of the file by echo echo $_SERVER['DOCUMENT_ROOT'];
.
here is working basic auth .htaccess script.
AuthType Basic
AuthName "Access to the Hidden Files"
AuthUserFile 'C:/xampp/htdocs/ht/.htpasswd'
Require valid-user
Before login
Afetr Login