[TYPO3] RealURL and multilingual error pages

Francois Suter fsuter at cobweb.ch
Fri Jan 18 11:32:12 CET 2008


Hi,

I have a web site with RealURL and 2 languages (French, default, and  
English). To redirect users to the right error page, I have the  
following in my configuration file:

if (preg_match('/^\/en\//', $_SERVER['REQUEST_URI'])) {
	$TYPO3_CONF_VARS['FE']['pageNotFound_handling'] = '/en/page-not- 
found/';
}
else { // Default language
	$TYPO3_CONF_VARS['FE']['pageNotFound_handling'] = '/fr/page- 
introuvable/';
}

This works fine when people type a non-existing URL after the  
language variable, but not if the language variable is missing, i.e.:

http://www.mysite.com/en/dgsdfgdsf	=>	http://www.mysite.com/en/page- 
not-found/
http://www.mysite.com/fr/dgsdfgdsf		=>	http://www.mysite.com/fr/page- 
introuvable/
http://www.mysite.com/dgsdfgdsf		=>	http://www.mysite.com/

In the last case, I would expect to be redirected to either http:// 
www.mysite.com/fr/page-introuvable/ or http://www.mysite.com/page- 
introuvable/

I suspect it is an error in my setup of the preVars in the RealURL  
config, but I can't find what. Here's the part about the preVars:

		// Pre variables
		'preVars' => array(
	
			// No cache
			array(
				'GETvar' => 'no_cache',
				'valueMap' => array(
					'no_cache' => 1,
				),
				'noMatch' => 'bypass',
				'_DEFAULT' => array(
					'type' => 'notfound'
				),
	   		),
	
			// Language
			array(
				'GETvar' => 'L',
				'valueMap' => array(
					'fr' => '0',
					'en' => '1',
				),
				'valueDefault' => 'fr',
			),

Anyone an idea where I may be wrong?

Thanks in advance

François Suter

-- 
Cobweb Development Sàrl
www.cobweb.ch

Rue Eugène-Marziano 15, CH-1227 Les Acacias (Geneva - Switzerland)
T: +41 22 880 00 93, F: +41 22 880 00 94, E: support at cobweb.ch
web solutions for professionnal requirements






More information about the TYPO3-english mailing list