title: Getting current path in htaccess
body: <p>I pretend to auto-include a file for all PHP scripts that are run in the server, so I was trying to use something like this:</p>
  <pre><code>php_value auto_prepend_file &quot;api/libraries.php&quot;
  </code></pre>
  <p>The problem with this is that it will work as long as anyone runs a PHP file located in the root folder. In case someone would wish to run it inside a folder (ex: myfolder/), then the syntax should be:</p>
  <pre><code>php_value auto_prepend_file &quot;../api/libraries.php&quot;
  </code></pre>
  <p>I know one solution would be to use the absolute path to the file:</p>
  <pre><code>php_value auto_prepend_file &quot;/var/www/html/api/libraries.php&quot;
  </code></pre>
  <p>But, since I'm trying to find a generic solution and I would like this to be able to run fine on any server, no matter what the path is, <strong>I would like to use some kind of &quot;variable&quot; to indicate the current path or generic method</strong>, without the need to modify the absolute path every time I install this anywhere. I don't even know whether this is possible.</p>
  <p>Variables like %{DOCUMENT_ROOT} are only available for Rewrite-related functions and it still provides the Root, not the current folder of the htaccess.</p>
  <p>I've been searching on internet for a solution, but I was not able to find any workaround to the issue.</p>
  <p>Is there any way to retrieve the current folder of the htaccess?
  Is it possible to use any kind of variable in &quot;php_value&quot;-related commands?</p>
  <p>Thank you very much in advance for your help.</p>