Bug #17878
closedmod_rewrite redirect to subdirectory + realurl = page not found
0%
Description
I have a site installed into /typo3 subdirecttory of hosting user home dir.
In that directory, .htaccess uses mod_rewrite to redirect certain domain to /typo3 directory:
RewriteCond %{HTTP_HOST} ^(www\.)?herethere\.info [NC]
RewriteRule ^/?(.*)$ typo3/$1 [L]
I have only changed the last mod_rewrite rule in typo3/.htaccess:
- For use with the RealUrl extension, you might need to remove the
- RewriteBase directive somewhere above and use this line instead of the
- next one:
RewriteRule ^(.*)$ /typo3/index.php [L]
The problem in Typo3 is that TYPO3_SITE_URL in t3lib\class.t3lib_div.php is calculated as:
case 'TYPO3_SITE_URL':
if (defined('PATH_thisScript') && defined('PATH_site')) {
$lPath = substr(dirname(PATH_thisScript),strlen(PATH_site)).'/';
$url = t3lib_div::getIndpEnv('TYPO3_REQUEST_DIR');
$siteUrl = substr($url,0,-strlen($lPath));
if (substr($siteUrl,-1)!='/') $siteUrl.='/';
$retVal = $siteUrl;
}
This returns "ts/Framework.html" instead of "Products/Framework.html". So I get "page not found".
While RealUrl expects TYPO3_SITE_URL to be config.baseURL.
This applies to 4.1.3 also.
I hacked it to use TYPO3_REQUEST_HOST ( http://herethere.info ) instead of TYPO3_REQUEST_DIR, but config.baseURL seems more correct way, if it is set.
(issue imported from #M6878)