[TYPO3-dev] getIndpEnv('TYPO3_DOCUMENT_ROOT') problems when using mod_rewrite in httpd.conf (Apache)

Martin Kutschker Martin.Kutschker at n0spam-blackbox.net
Tue Aug 22 18:08:25 CEST 2006


Hi!

getIndpEnv() tries to determine the DOCUMENT_ROOT from SCRIPT_FILENAME and 
SCRIPT_NAME. This works in .htacess like this:

URL: http://host/base/abc/def

SCRIPT_NAME /URL_base/index.php
SCRIPT_FILENAME /file/system/base/index.php

But in httpd.conf the situation is like this:

SCRIPT_FILENAME	/file/system/base/index.php
SCRIPT_NAME /URL_base/abc/def

Now SCRIPT_NAME shows the real URL, and only SCRIPT_FILENAME reflects the 
file system path.

The result is a broken TYPO3_DOCUMENT_ROOT. It simpyl is empty because both 
  variable has have no "common end".

The code in getIndpDev has this note that some webserver configs "will 
deliver a 'wrong' DOCUMENT_ROOT (according to our description)". But it 
doesn't tell what "our description" is. DOCUMENT_ROOT is in both versions 
correct. That is it simply shows the configured DOCUMENT_ROOT of the webserver.

Perhaps the function can be modified to use DOCUMENT_ROOT as a fallback if 
its normal operation results in an empty string.

Masi




More information about the TYPO3-dev mailing list