This is an exension to this question where we learn that we can set a $_SERVER var using SetEnv.
The next question is: Is there a way to use SetEnv essentially like this:
/var/www/www.example.com/module/unique_section/.htaccess:
SetEnv RESOURCE_ROOT %{DIRECTORY}
/var/www/www.example.com/module/unique_section/some/path/file.php
<?php echo $_SERVER['RESOURCE_ROOT']; ?>
Output: /var/www/www.example.com/module/unique_section/
.htaccessfile is in?RewriteRuleknown what directory the.htaccessfile is in. I don't think so... but you could use%{DOCUMENT_ROOT}plus some static string... I'll research this further....htaccessfile can know the path to itself. So I think you'll need to use hardcoded paths...