title: How to use a RELATIVE path with AuthUserFile in htaccess?
body: <p>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.</p>
  
  <p>So even though I have the .htaccess and .htpasswd files in the same directory, this doesn't work:</p>
  
  <pre><code>AuthType Basic
  AuthName "Private Login"
  AuthUserFile .htpasswd
  Require valid-user
  </code></pre>
  
  <p>However, it does work if I change the AuthUserFile to use the absolute path:</p>
  
  <pre><code>AuthType Basic
  AuthName "Private Login"
  AuthUserFile "/home/user/public_html/mydir/.htpasswd"
  Require valid-user
  </code></pre>
  
  <p>But I would prefer something more mobile as I use this on multiple sites in different areas. I've searched the web but haven't had any resolution. Is it possible to use relative path or variables like <code>%{DOCUMENT_ROOT}</code>? </p>