[Typo3-dev] t3lib_div::getIndpEnv('TYPO3_SITE_URL') ?!?!

Martin Kutschker Martin.Kutschker at n0spam-blackbox.net
Mon Dec 12 18:08:23 CET 2005


Hi!

I was trying to figure out what this "enviroment variable" is supposed 
to contain.

Why? Because I tried to set up Real URL and failed.

After fiddling for some time with my Apache config, I looked into Real 
URL and the TYPO3 enviroments.

What I do not understand why TYPO3_SITE_URL, which operates on the URL 
is changed with the file path:

$lPath = substr(dirname(PATH_thisScript),strlen(PATH_site)).'/';
t3lib_div::getIndpEnv('TYPO3_REQUEST_DIR');
$siteUrl = substr($url,0,-strlen($lPath));
if (substr($siteUrl,-1)!='/')	$siteUrl.='/';

The result is wrong for me:

   http://myhost.com/foo/bar/test.html => http://myhost.com/foo/bar/

But if I change the definition of $lPath to this:

$lPath = t3lib_div::dirname(t3lib_div::getIndpEnv('SCRIPT_NAME')).'/';

I get something else, which is correct for me:

   http://myhost.com/foo/bar/test.html => http://myhost.com/

Now Real URL works again.

This is my Apache config.

<VirtualHost *:80>
         RewriteEngine On
         RewriteLog /var/log/apache2/rewrite_log
         RewriteLogLevel 5
         RewriteRule ^/typo3$ - [L]
         RewriteRule ^/typo3conf$ - [L]
         RewriteRule ^/typo3/.*$ - [L]

# odd! rewrite log showed me that I have to prepend the path to the host
         RewriteCond /srv/www%{REQUEST_FILENAME} !-f
         RewriteCond /srv/www%{REQUEST_FILENAME} !-d
         RewriteCond /srv/www%{REQUEST_FILENAME} !-l
         RewriteRule .* /index.php
</VirtualHost>

What strikes me that I have to use a different argument for the 
RewriteConds than suggested in the manual. Why?

Masi




More information about the TYPO3-dev mailing list