[TYPO3] CoolUri problem with subdirectory

Jan Bednarik info at bednarik.org
Mon Sep 8 21:44:16 CEST 2008


Hi,

> The problem seems to be related to line 35 in class.tx_cooluri.php:
> $paramsinurl = t3lib_div::getIndpEnv('REQUEST_URI');

The whole code looks like this:

if (!empty($params['pObj']->siteScript)) {
       $cond = $params['pObj']->siteScript && 
substr($params['pObj']->siteScript,0,9)!='index.php' && 
substr($params['pObj']->siteScript,0,1)!='?';
       $paramsinurl = '/'.$params['pObj']->siteScript;
     } else {
       $cond = t3lib_div::getIndpEnv('REQUEST_URI') && 
substr(t3lib_div::getIndpEnv('REQUEST_URI'),1,9)!='index.php' && 
substr(t3lib_div::getIndpEnv('REQUEST_URI'),1,1)!='?';
       $paramsinurl = t3lib_div::getIndpEnv('REQUEST_URI');
     }


so, REQUEST_URI is used only when Typo3 doesn't set siteScript, which 
happens for to me unknown reason.

It's set by:

this->siteScript = t3lib_div::getIndpEnv('TYPO3_SITE_SCRIPT');

which is said to be

TYPO3_SITE_SCRIPT = [script / Speaking URL] of the TYPO3 website

impl: 
substr(t3lib_div::getIndpEnv('TYPO3_REQUEST_URL'),strlen(t3lib_div::getIndpEnv('TYPO3_SITE_URL'))); 


and it goes deeeeeper. I'd try to find out, why siteScript is empty. 
Request_uri is just a fallback.

RealUrl uses just siteScript:

// If there has been a redirect (basically; we arrived here otherwise 
than via "index.php" in the URL) this can happend either due to a 
CGI-script or because of reWrite rule. Earlier we used 
$GLOBALS['HTTP_SERVER_VARS']['REDIRECT_URL'] to check but...
		if ($this->pObj->siteScript && substr($this->pObj->siteScript, 0, 9) 
!= 'index.php' && substr($this->pObj->siteScript, 0, 1) != '?') {

-- 
Jan Bednarik
www.bednarik.org - web about Typo3 in czech


More information about the TYPO3-english mailing list