How to use a RELATIVE path with AuthUserFile in htaccess?
问题 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 even though I have the .htaccess and .htpasswd files in the same directory, this doesn't work: AuthType Basic AuthName "Private Login" AuthUserFile .htpasswd Require valid-user However, it does work if I change the AuthUserFile to use the absolute path: AuthType Basic AuthName "Private Login" AuthUserFile "/home/user/public_html