Access the value of $ _SERVER ['DOCUMENT_ROOT'] in the .htaccess file

I need the path specified in $ _SERVER ['DOCUMENT_ROOT'] to be available in the .htaccess file. Is there any way to access it?

I basically need to point to the file stored in the root directory, and I need the actual path to the file system, not the URL path. So instead of using a hard coded value, I would like to use a variable.

Thank.

+1
source share
2 answers

$ _ SERVER is a PHP variable, while .htaccess files use the Apache configuration language. Unfortunately, there is no way to get to PHP from the Apache configuration files.

, , - script .htaccess . , .

+2

, % {DOCUMENT_ROOT} RewriteCond

+2

All Articles