[Typo3-dev] t3lib_div::getIndpEnv('TYPO3_SITE_URL') ?!?!
Kasper Skårhøj
kasper2005 at typo3.com
Wed Dec 14 21:57:40 CET 2005
Hi Martin,
Yes, realurl is authorized to work with .htaccess files only (officially).
I don't know how it can be made to work with httpd.conf and I have closed my
eyes to the problem because; a few years ago we had nothing but trouble to
get unified values from environment inside TYPO3 - hence the
t3lib_div::getIndpEnv() function and though I'm sure a quick change in there
somehow could help you I just can't defend running the risk of changing
anything in there since it has been working for years now with no significant
complaints - except with realurl :-)
- kasper
On Monday 12 December 2005 18:08, Martin Kutschker wrote:
> 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
> _______________________________________________
> Typo3-dev mailing list
> Typo3-dev at lists.netfielders.de
> http://lists.netfielders.de/cgi-bin/mailman/listinfo/typo3-dev
--
- kasper
-----------------
"A 'please' would be nice", John Travolta, Pulp Fiction
More information about the TYPO3-dev
mailing list