Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save julianxhokaxhiu/e5332b17f4ea6a5157262d2ebb449a53 to your computer and use it in GitHub Desktop.
Save julianxhokaxhiu/e5332b17f4ea6a5157262d2ebb449a53 to your computer and use it in GitHub Desktop.
RealURL Configuration for Domain == Language

This config shows an example of TYPO3 RealURL configuration, to map languages to domains.

Lets say the default language (L=0) is german and the foreign language is english (L=1). Normally RealURL would create links like that:

This example is about getting rid of the /en path segment.

<?php
$TYPO3_CONF_VARS['EXTCONF']['realurl'] = array(
'_DOMAINS' => array(
'encode' => array(
array(
'GETvar' => 'L',
'value' => 0,
'ifDifferentToCurrent' => 1,
'useConfiguration' => 'www.domain.de',
'urlPrepend' => 'http://www.domain.de',
),
array(
'GETvar' => 'L',
'value' => 1,
'ifDifferentToCurrent' => 1,
'useConfiguration' => 'www.domain.com',
'urlPrepend' => 'http://www.domain.com',
)
),
'decode' => array(
'www.domain.de' => array(
'GETvars' => array(
'L' => 0
),
'useConfiguration' => 'www.domain.de'
),
'www.domain.com' => array(
'GETvars' => array(
'L' => 1
),
'useConfiguration' => 'www.domain.com'
),
)
),
'www.domain.de' => array(
'enableDomainLookup' => 1,
'preVars' => array(
// ...
// L is not required here, now
),
// ...
),
'www.domain.com' => array(
'enableDomainLookup' => 1,
'preVars' => array(
// ...
// L is not required here, now
),
// ...
),
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment