[TYPO3-v4] translateable 404 error page with realurl

Michael Stucki michael.stucki at typo3.org
Tue Dec 6 23:27:21 CET 2011


Hi François,

> I use the following (in localconf), which is not very nice but works:
> 
>     // Set error page for multilingual site
> if (preg_match('/^\/en\//', $_SERVER['REQUEST_URI'])) {
>     $TYPO3_CONF_VARS['FE']['pageNotFound_handling'] =
> '/en/page-not-found/';
> } elseif (preg_match('/^\/de\//', $_SERVER['REQUEST_URI'])) {
>     $TYPO3_CONF_VARS['FE']['pageNotFound_handling'] =
> '/de/seite-nicht-gefunden/';
> } else { // Default language
>     $TYPO3_CONF_VARS['FE']['pageNotFound_handling'] = '/page-introuvable/';
> }

A little off-topic but still worth to be mentioned:
I would avoid writing such code into localconf.php because the install
tool may likely break it if you safe something from there.

Therefore, you should always move PHP logic into separate files, ideally
into your own extension's ext_localconf.php.

- michael

-- 
Use a newsreader! Check out
http://typo3.org/community/mailing-lists/use-a-news-reader/


More information about the TYPO3-project-v4 mailing list