[TYPO3-english] TYPO3 in subdirectory with silent domain redirect

Federico Bernardin typo3list at bernardin.it
Mon Oct 15 09:06:23 CEST 2012


Hi Jan, why don't you create a new apache virtualhost pointing to your old directory?

cheers
Federico

Il giorno 12/ott/2012, alle ore 09:32, Jan Bednarik <info at bednarik.org> ha scritto:

> Hey,
> 
> I have a TYPO3 installed in a subdirectory "old" and I want it to run on a domain www.example.com.
> 
> In order to redirect all requests to the subdirectory, I placed into the main directory's .htaccess this:
> 
> RewriteCond %{HTTP_HOST} ^(www\.)?wellness-spa\.cz$
> RewriteRule ^(?!old/)(.*)$ /old/$1 [L]
> 
> Since I want nice URLs, I have the default .htaccess in old directory. So far, it is fine.
> 
> However, when I go to www.example.com/typo3, I'm redirected to www.example.com/old/typo3, still works and is fine.
> 
> But the problem is that the View module in TYPO3 then displays www.example.com/old/nice/url, which is obviously not recognized.
> 
> I tried all sort of things with .htaccess, but without luck. The last resort was hacking index.php and adding:
> 
> if (substr($_SERVER['REQUEST_URI'],0,4) == '/old') {
>  header('Location: http://www.example.com'.substr($_SERVER['REQUEST_URI'],4,strlen($_SERVER['REQUEST_URI'])-4),301);
>  exit;
> }
> 
> Since it's a terrible hack, I'm asking here, whether someone managed to make this scenario working.
> 
> Thanks
> 
> Jan
> _______________________________________________
> TYPO3-english mailing list
> TYPO3-english at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-english



More information about the TYPO3-english mailing list