-
-
Save Norcoen/5864c5ca42e93198efcbbf7c36a0c638 to your computer and use it in GitHub Desktop.
Revisions
-
lorenzulrich revised this gist
Nov 28, 2017 . 1 changed file with 0 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -32,7 +32,6 @@ 'enableUrlDecodeCache' => 1, 'enableUrlEncodeCache' => 1, ], 'redirects_regex' => [], 'preVars' => [ [ -
lorenzulrich revised this gist
Nov 28, 2017 . 1 changed file with 80 additions and 160 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,165 +1,85 @@ <?php $realUrlSiteConfigurations = [ 'site1' => [ 'rootPageUid' => 1, 'schema' => 'https', 'languageDomainMap' => [ 0 => 'www.site1.ch', 1 => 'www.site1.fr', 2 => 'www.site1.it', ] ], 'site2' => [ 'rootPageUid' => 2, 'schema' => 'https', 'languageDomainMap' => [ 0 => 'www.site2.ch', 1 => 'www.site2.fr', 2 => 'www.site3.it', ] ] ]; # Could be used to override depending on global configuration, e.g. for staging/latest environment #$realUrlSiteConfigurationOverrides = require_once(dirname(__FILE__) . '/../../Configuration/current/RealUrlConfiguration.php'); #\TYPO3\CMS\Core\Utility\ArrayUtility::mergeRecursiveWithOverrule($realUrlSiteConfigurations, # $realUrlSiteConfigurationOverrides); $realUrlDefaultConfiguration = [ 'init' => [ 'enableCHashCache' => 1, 'appendMissingSlash' => 'ifNotFile', 'enableUrlDecodeCache' => 1, 'enableUrlEncodeCache' => 1, ], 'enableDomainLookup' => true, 'redirects_regex' => [], 'preVars' => [ [ 'GETvar' => 'no_cache', 'valueMap' => [ ], 'noMatch' => 'bypass', ], [ 'GETvar' => 'L', 'valueMap' => [ 'de' => '0', 'fr' => '1', 'it' => '2', ], 'noMatch' => 'bypass', ], ], 'pagePath' => [ 'type' => 'user', 'userFunc' => 'EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main', 'spaceCharacter' => '-', 'languageGetVar' => 'L', 'expireDays' => 7, 'rootpage_id' => 1, ], 'fixedPostVars' => [], 'postVarSets' => [], 'fileName' => [], ]; foreach ($realUrlSiteConfigurations as $siteName => $realUrlSiteConfiguration) { foreach ($realUrlSiteConfiguration['languageDomainMap'] as $languageUid => $domain) { $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl'][$domain] = $realUrlDefaultConfiguration; $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl'][$domain]['pagePath']['rootpage_id'] = $realUrlSiteConfiguration['rootPageUid']; $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['_DOMAINS']['encode'][] = [ 'rootpage_id' => $realUrlSiteConfiguration['rootPageUid'], 'GETvar' => 'L', 'value' => $languageUid, 'urlPrepend' => $realUrlSiteConfiguration['schema'] . '://' . $domain, 'useConfiguration' => $domain, ]; $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['_DOMAINS']['decode'][$domain] = [ 'GETvars' => [ 'L' => $languageUid, ], 'useConfiguration' => $domain, ]; } } -
lorenzulrich revised this gist
Feb 8, 2016 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,14 +1,14 @@ <?php $site1De = 'www.foo.de'; $site1DeWithPrefix = 'http://' . $site1De; $site1Fr = 'www.foo.fr'; $site1FrWithPrefix = 'http://' . $site1Fr; $site1It = 'www.foo.it'; $site1ItWithPrefix = 'http://' . $site1It; $site2De = 'www.bar.de'; $site2DeWithPrefix = 'http://' . $site2De; $site2Fr = 'www.bar.fr'; $site2FrWithPrefix = 'http://' . $site2Fr; -
lorenzulrich revised this gist
Feb 8, 2016 . 1 changed file with 6 additions and 6 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -2,18 +2,18 @@ <?php $site1De = 'www.foo.ch'; $site1DeWithPrefix = 'http://' . $site1De; $site1Fr = 'www.foo.fr'; $site1FrWithPrefix = 'http://' . $site1Fr; $site1It = 'www.foo.it'; $site1ItWithPrefix = 'http://' . $site1It; $site2De = 'www.bar.ch'; $site2DeWithPrefix = 'http://' . $site2De; $site2Fr = 'www.bar.fr'; $site2FrWithPrefix = 'http://' . $site2Fr; $site2It = 'www.bar.it'; $site2ItWithPrefix = 'http://' . $site2It; $GLOBALS['TYPO3_CONF_VARS']['FE']['addRootLineFields'] .= ',tx_realurl_pathsegment,alias,nav_title,title'; -
lorenzulrich revised this gist
Feb 8, 2016 . 1 changed file with 44 additions and 74 deletions.There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -1,25 +1,25 @@ <?php $site1De = 'www.foo.ch'; $site1DeWithPrefix = 'http://' . $dsjDe; $site1Fr = 'www.foo.fr'; $site1FrWithPrefix = 'http://' . $dsjFr; $site1It = 'www.foo.it'; $site1ItWithPrefix = 'http://' . $dsjIt; $site2De = 'www.bar.ch'; $site2DeWithPrefix = 'http://' . $jupaDe; $site2Fr = 'www.bar.fr'; $site2FrWithPrefix = 'http://' . $jupaFr; $site2It = 'www.bar.it'; $site2ItWithPrefix = 'http://' . $jupaIt; $GLOBALS['TYPO3_CONF_VARS']['FE']['addRootLineFields'] .= ',tx_realurl_pathsegment,alias,nav_title,title'; $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl'] = array( $site1De => array( 'init' => array( 'enableCHashCache' => true, 'appendMissingSlash' => 'ifNotFile,redirect', @@ -54,85 +54,55 @@ ), 'postVarSets' => array( '_DEFAULT' => array( ) ) ), ); if (preg_match('/www\.(site1)\.(?:(ch|fr|it))$/', $_SERVER['HTTP_HOST'])) { $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['_DOMAINS'] = array( 'encode' => array( array( 'GETvar' => 'L', 'value' => '0', 'useConfiguration' => $site1De, 'urlPrepend' => $site1DeWithPrefix, 'ifDifferentToCurrent' => 'true' ), array( 'GETvar' => 'L', 'value' => '1', 'useConfiguration' => $site1Fr, 'urlPrepend' => $site1FrWithPrefix, 'ifDifferentToCurrent' => 'true' ), array( 'GETvar' => 'L', 'value' => '2', 'useConfiguration' => $site1It, 'urlPrepend' => $site1ItWithPrefix, 'ifDifferentToCurrent' => 'true' ), ), 'decode' => array( $site1De => array( 'GETvars' => array( 'L' => '' ), 'useConfiguration' => $site1De ), $site1Fr => array( 'GETvars' => array( 'L' => '1' ), 'useConfiguration' => $site1Fr ), $site1It => array( 'GETvars' => array( 'L' => '2' ), 'useConfiguration' => $site1It ), ) ); @@ -142,54 +112,54 @@ array( 'GETvar' => 'L', 'value' => '0', 'useConfiguration' => $site2De, 'urlPrepend' => $site2DeWithPrefix, 'ifDifferentToCurrent' => 'true' ), array( 'GETvar' => 'L', 'value' => '1', 'useConfiguration' => $site2Fr, 'urlPrepend' => $site2FrWithPrefix, 'ifDifferentToCurrent' => 'true' ), array( 'GETvar' => 'L', 'value' => '2', 'useConfiguration' => $site2It, 'urlPrepend' => $site2ItWithPrefix, 'ifDifferentToCurrent' => 'true' ) ), 'decode' => array( $site2De => array( 'GETvars' => array( 'L' => '' ), 'useConfiguration' => $site2De ), $site2Fr => array( 'GETvars' => array( 'L' => '1' ), 'useConfiguration' => $site2Fr ), $site2It => array( 'GETvars' => array( 'L' => '2' ), 'useConfiguration' => $site2It ) ) ); } $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl'][$site1Fr] = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl'][$site1De]; $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl'][$site1It] = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl'][$site1De]; $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl'][$site2De] = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl'][$site1De]; $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl'][$site2De]['pagePath']['rootpage_id'] = 6; $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl'][$site2Fr] = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl'][$site2De]; $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl'][$site2It] = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl'][$site2De]; -
lorenzulrich created this gist
Feb 8, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,195 @@ <?php $dsjDe = 'dev.dsj.ch'; $dsjDeWithPrefix = 'http://' . $dsjDe; $dsjFr = 'dev.fspj.ch'; $dsjFrWithPrefix = 'http://' . $dsjFr; $dsjIt = 'dev.fspg.ch'; $dsjItWithPrefix = 'http://' . $dsjIt; $jupaDe = 'dev.jugendparlamente.ch'; $jupaDeWithPrefix = 'http://' . $jupaDe; $jupaFr = 'dev.parlementsdesjeunes.ch'; $jupaFrWithPrefix = 'http://' . $jupaFr; $jupaIt = 'dev.parlamentideigiovani.ch'; $jupaItWithPrefix = 'http://' . $jupaIt; $GLOBALS['TYPO3_CONF_VARS']['FE']['addRootLineFields'] .= ',tx_realurl_pathsegment,alias,nav_title,title'; $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl'] = array( $dsjDe => array( 'init' => array( 'enableCHashCache' => true, 'appendMissingSlash' => 'ifNotFile,redirect', 'adminJumpToBackend' => true, 'enableUrlDecodeCache' => true, 'enableUrlEncodeCache' => true, 'emptyUrlReturnValue' => '/' ), 'pagePath' => array( 'type' => 'user', //'disablePathCache' => true, 'userFunc' => 'EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main', 'spaceCharacter' => '-', 'languageGetVar' => 'L', 'rootpage_id' => '1' ), 'fileName' => array( 'defaultToHTMLsuffixOnPrev' => 0, 'acceptHTMLsuffix' => 0 ), 'preVars' => array( array( 'GETvar' => 'L', 'valueMap' => array( 'de' => 0, 'fr' => 1, 'it' => 2 ), 'valueDefault' => 'de', 'noMatch' => 'bypass' ) ), 'postVarSets' => array( '_DEFAULT' => array( // EXT:news start 'news' => array( array( 'GETvar' => 'tx_news_pi1[action]', ), array( 'GETvar' => 'tx_news_pi1[controller]', ), array( 'GETvar' => 'tx_news_pi1[news]', 'lookUpTable' => array( 'table' => 'tx_news_domain_model_news', 'id_field' => 'uid', 'alias_field' => 'title', 'addWhereClause' => ' AND NOT deleted', 'useUniqueCache' => 1, 'useUniqueCache_conf' => array( 'strtolower' => 1, 'spaceCharacter' => '-', ), 'languageGetVar' => 'L', 'languageExceptionUids' => '', 'languageField' => 'sys_language_uid', 'transOrigPointerField' => 'l10n_parent', 'autoUpdate' => 1, 'expireDays' => 180, ), ), ), // EXT:news end ) ) ), ); if (preg_match('/(?:(www|dev)\.)(dsj|fspj|fspg)\.ch$/', $_SERVER['HTTP_HOST'])) { $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['_DOMAINS'] = array( 'encode' => array( array( 'GETvar' => 'L', 'value' => '0', 'useConfiguration' => $dsjDe, 'urlPrepend' => $dsjDeWithPrefix, 'ifDifferentToCurrent' => 'true' ), array( 'GETvar' => 'L', 'value' => '1', 'useConfiguration' => $dsjFr, 'urlPrepend' => $dsjFrWithPrefix, 'ifDifferentToCurrent' => 'true' ), array( 'GETvar' => 'L', 'value' => '2', 'useConfiguration' => $dsjIt, 'urlPrepend' => $dsjItWithPrefix, 'ifDifferentToCurrent' => 'true' ), ), 'decode' => array( $dsjDe => array( 'GETvars' => array( 'L' => '' ), 'useConfiguration' => $dsjDe ), $dsjFr => array( 'GETvars' => array( 'L' => '1' ), 'useConfiguration' => $dsjFr ), $dsjIt => array( 'GETvars' => array( 'L' => '2' ), 'useConfiguration' => $dsjIt ), ) ); } else { $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['_DOMAINS'] = array( 'encode' => array( array( 'GETvar' => 'L', 'value' => '0', 'useConfiguration' => $jupaDe, 'urlPrepend' => $jupaDeWithPrefix, 'ifDifferentToCurrent' => 'true' ), array( 'GETvar' => 'L', 'value' => '1', 'useConfiguration' => $jupaFr, 'urlPrepend' => $jupaFrWithPrefix, 'ifDifferentToCurrent' => 'true' ), array( 'GETvar' => 'L', 'value' => '2', 'useConfiguration' => $jupaIt, 'urlPrepend' => $jupaItWithPrefix, 'ifDifferentToCurrent' => 'true' ) ), 'decode' => array( $jupaDe => array( 'GETvars' => array( 'L' => '' ), 'useConfiguration' => $jupaDe ), $jupaFr => array( 'GETvars' => array( 'L' => '1' ), 'useConfiguration' => $jupaFr ), $jupaIt => array( 'GETvars' => array( 'L' => '2' ), 'useConfiguration' => $jupaIt ) ) ); } $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl'][$dsjFr] = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl'][$dsjDe]; $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl'][$dsjIt] = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl'][$dsjDe]; $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl'][$jupaDe] = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl'][$dsjDe]; $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl'][$jupaDe]['pagePath']['rootpage_id'] = 6; $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl'][$jupaFr] = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl'][$jupaDe]; $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl'][$jupaIt] = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl'][$jupaDe];