[TYPO3-english] Redirect to subdirectory - siteScript is shortend

Jan Bednarik info at bednarik.org
Wed Oct 3 23:14:03 CEST 2012


Hi,

I have a TYPO3 (4.5) running in a subdirectory "old", I'm now 
redirecting a domain example.com to this subdirectory:

RewriteCond %{HTTP_HOST} ^(www\.)?example\.com$
RewriteRule ^(.*)$  /old/$1 [L]

The problem is, that I want to use CoolUri for this new domain, but it 
doesn't work since $params['pObj']->siteScript is shortend by 3 characters.

For example - URL www.example.com/lorem/ipsum will produce 
$params['pObj']->siteScript "em/ipsum" and that's not correct.

For the time being, I've commented out a piece of code in CoolUri and 
I'm taking the path directly from t3lib_div::getIndpEnv('REQUEST_URI'), 
however, that's not correct.

I think the problem is in t3lib_div:

case 'TYPO3_SITE_URL':
				if (defined('PATH_thisScript') && defined('PATH_site')) {
					$lPath = substr(dirname(PATH_thisScript), strlen(PATH_site)) . '/';
					$url = self::getIndpEnv('TYPO3_REQUEST_DIR');
					$siteUrl = substr($url, 0, -strlen($lPath));
					if (substr($siteUrl, -1) != '/') {
						$siteUrl .= '/';
					}
					$retVal = $siteUrl;
				}
				break;

Any ideas?

Thanks

Jan


More information about the TYPO3-english mailing list