I
I
Ivan2021-02-08 14:16:52
htaccess
Ivan, 2021-02-08 14:16:52

How to specify the path to the home directory in HTACCESS in one variable?

Hello. I am new to PHP. I wrote a php script, placed the file in the main directory on the hosting and I want it to be processed every time a person visits any page of my site.
To do this, I wrote the following in HTACCESS:

php_value auto_prepend_file /home/блаблабла/public_html/antiddos.php


The question is: is there any way to shorten the given string "/home/blablabla/public_html/" by replacing it with a single variable. Tried to do something similar:
php_value auto_prepend_file https://%{SERVER_NAME}/antiddos.php


But the site is down. What to do?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question