Apache .htaccess password protect with relative path Apache .htaccess password protect with relative path apache apache

Apache .htaccess password protect with relative path


I don’t think that’s possible. The AuthUserFile directive requires the file-path to be either absolute (thus from file system root) or relative from the server root.


The AuthUserFile paths are relative to the server root (/etc/apache2/ on Debian), or absolute.

To take care of different servers, you can use IfDefine directives with different variables on each server - see my blog post about that.