Skip to content

Instantly share code, notes, and snippets.

@lorenzulrich
Created October 25, 2013 00:43
Show Gist options
  • Save lorenzulrich/7147678 to your computer and use it in GitHub Desktop.
Save lorenzulrich/7147678 to your computer and use it in GitHub Desktop.
RealURL configuration for multi-language and multi-domain setups
<?php
/* http://www.typo3.net/artikel/typo3-howto-domain-basierte-sprachumschaltung-mit-realurl/ */
$TYPO3_CONF_VARS['EXTCONF']['realurl'] = array (
'www.mysite.ch' => array(
'init' => array(
'enableCHashCache' => 1,
'appendMissingSlash' => 'ifNotFile',
'enableUrlDecodeCache' => 1,
'enableUrlEncodeCache' => 1,
),
'redirects_regex' => array(),
'preVars' => array(
array(
'GETvar' => 'no_cache',
'valueMap' => array(
'no_cache' => 1,
),
'noMatch' => 'bypass',
),
array(
'GETvar' => 'L',
'valueMap' => array(
'de' => '0',
'fr' => '1',
),
'noMatch' => 'bypass',
'valueDefault' => 'de',
),
),
'pagePath' => array(
'type' => 'user',
'userFunc' => 'EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main',
'spaceCharacter' => '-',
'languageGetVar' => 'L',
'expireDays' => 7,
'rootpage_id' => 1,
),
'fixedPostVars' => array(),
'postVarSets' => array(),
'fileName' => array(),
),
);
$TYPO3_CONF_VARS['EXTCONF']['realurl']['www.mysite.fr'] = $TYPO3_CONF_VARS['EXTCONF']['realurl']['www.mysite.ch'];
$TYPO3_CONF_VARS['EXTCONF']['realurl']['_DOMAINS'] = array(
'encode' => array(
array(
'GETvar' => 'L',
'value' => '',
'ifDifferentToCurrent' => TRUE,
'useConfiguration' => 'www.mysite.ch',
'urlPrepend' => 'http://www.mysite.ch',
),
array(
'GETvar' => 'L',
'value' => '0',
'ifDifferentToCurrent' => TRUE,
'useConfiguration' => 'www.mysite.ch',
'urlPrepend' => 'http://www.mysite.ch',
),
array(
'GETvar' => 'L',
'value' => '1',
'ifDifferentToCurrent' => TRUE,
'useConfiguration' => 'www.mysite.fr',
'urlPrepend' => 'http://www.mysite.fr',
),
),
'decode' => array(
'www.mysite.ch' => array(
'GETvars' => array(
'L' => '',
),
'useConfiguration' => 'www.mysite.ch',
),
'www.mysite.fr' => array(
'GETvars' => array(
'L' => '1',
),
'useConfiguration' => 'www.mysite.fr',
),
),
);
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment