Is it possible to get the absolut path to my ".htaccess" file?
Im using this to load init.php
in every file.
php_value auto_prepend_file /Applications/XAMPP/xamppfiles/htdocs/init.php
Is there a way so I don't have to write the absolute path?
Like this, if init.php
is in the same category as the .htaccess
file:
php_value auto_prepend_file [ABSOLUTE_PATH_TO_HTACCESS]/init.php
and if that is possible, how do I write that but still go back one directory (Since init.php
is outside public_html
, where the .htaccess
is).
Thanks in advance.
Assuming the updated response on the accepted answer here works, and that your relative directory structure is as you describe:
[docroot]
|
\- init.php
|
\- public_html
|
\- .htaccess
|
\- index.php
then you should be able to go up one directory to the init.php
file you wish to prepend by including the directive
php_value auto_prepend_file ./../init.php
in your .htaccess file.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With