[TYPO3-english] realurl configuration for different multilanguage domains

jean-sebastien_gervais at ssss.gouv.qc.ca jean-sebastien_gervais at ssss.gouv.qc.ca
Wed Apr 24 16:38:36 CEST 2013


Hello again Michaela


I just like to add, it seems both websites won't have the same «default» 
language.  While both sites will need to use lang id 0  (default content) 
it *can* and will be in a different language by the editors. 
So basically, default language of domain1 is german while default lanugage 
of domain2 is english

Correct language config for real url (at the end of the script I sent you) 
should be 
$TYPO3_CONF_VARS['EXTCONF']['realurl']['www.domain2.com']['preVars']['0']['valueMap']['en'] 
= 0;
$TYPO3_CONF_VARS['EXTCONF']['realurl']['www.domain2.com']['preVars']['0']['valueMap']['gr'] 
 = 2;

In the backend, make sure each editor groups only have access to  language 
translations  (that is, de and gr for domain1  and only gr for domain2, 
since they will both have a default language)

Next thing you will have to watch for will be some typocript will need to 
be wrapped with language conditions.  You should be able to find examples 
pretty easily.

Best regards, 
Jean-Sébastien Gervais

typo3-english-bounces at lists.typo3.org a écrit sur 2013-04-24 10:23:51 :

> De : jean-sebastien_gervais at ssss.gouv.qc.ca
> A : Michaela <m.herzhauser at gmx.de>, TYPO3 English <typo3-
> english at lists.typo3.org>
> Date : 2013-04-24 10:24
> Objet : Re: [TYPO3-english] realurl configuration for different 
> multilanguage domains
> Envoyé par : typo3-english-bounces at lists.typo3.org
> 
> Hello Michaela 
> 
> Try to set specific configs  each domains with this example : 
> 
> <?php
> 
> $TYPO3_CONF_VARS['FE']['addRootLineFields'] .= 
> ',tx_realurl_pathsegment,alias,nav_title,title';
> 
> $TYPO3_CONF_VARS['EXTCONF']['realurl'] = array();
> 
> $TYPO3_CONF_VARS['EXTCONF']['realurl']['_DEFAULT'] = array(
>         'init' => array(
>                 'enableCHashCache'              => 1
>                 , 'enableUrlDecodeCache'        => 1
>                 , 'enableUrlEncodeCache'        => 1
>                 , 'appendMissingSlash'  => 'ifNotFile,redirect'
>                 , 'respectSimulateStaticURLs' => 0
>                 , 'postVarSet_failureMode' => ''
>                     , 'adminJumpToBackend'       => '1' 
>                     , 'respectSimulateStaticURLs' => '1'
>                     , 'emptyUrlReturnValue'      => '/' 
>                     , 'disableErrorLog'          => '1' 
>         )
>         , 'redirects'           => array('sitemap.xml' => 
> 'index.php?eID=dd_googlesitemap')
>         , 'preVars' => array(
>                 array(
>                         'GETvar' => 'no_cache',
>                         'valueMap' => array(
>                                 'no-cache' => 1,
>                         ),
> //                       'GETvar' => 'L', //will be set for each domains 

> instead
> //                            'valueMap' => array(
> //                                'de' => 0,
> //                                'en' => 1,
> //                                        'gr' => 2,
> //                            ),
>                         'noMatch' => 'bypass',
>                         //'valueDefault' => 'fr',
>                 ),
>         )
>         , 'pagePath' => array(
>                 'type'                  => 'user'
>                 , 'userFunc'            => 
> 'EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main'
>                 , 'spaceCharacter'      => '_'
>                 , 'languageGetVar'      => 'L'
>                 , 'rootpage_id'         => 1
>                 , 'disablePathCache'    => 0
>                 , 'expireDays'          => 1
>                     , 'firstHitPathCache'   => 1
>                 , 'segTitleFieldList'   => 
> 'tx_realurl_pathsegment,alias,nav_title,title'
>                 , 'excludePageIds'      => 1
>         )
>         , 'fixedPostVars'       => array()
>         , 'postVarSets' => array(
>                 '_DEFAULT' => array(
> //                      'hash' => array(
> //                              array(
> //                                      'GETvar' => 'cHash'
> //                              )
> //                      )
> 
> 
>                 'article' => array(
>                      array(
>                              'GETvar' => 'tx_ttnews[tt_news]',
>                              'lookUpTable' => array(
>                                      'table' => 'tt_news',
>                                      'id_field' => 'uid',
>                                      'alias_field' => 'title',
>                                      'addWhereClause' => ' AND NOT 
> deleted',
>                                      'useUniqueCache' => 1,
>                                      'useUniqueCache_conf' => array(
>                                              'strtolower' => 1,
>                                              'spaceCharacter' => '_',
>                                      ),
>                              ),
>                      ),
>             ),
> 
> 
> 
>                 )
> 
>         )
>         , 'fileName' => array (
>                 'index' => array(
>                         'index.html' => array(
>                                 'keyValues' => array(
>                                         'type' => 0,
>                                 )
>                         )
>                         , 'print.html' => array(
>                                 'keyValues' => array(
>                                         'print' => 1,
>                                 )
>                         )
>                         , 'rss.xml' => array(
>                                 'keyValues' => array(
>                                         'type' => 100,
>                                 )
>                         )
>                         , 'minical.html' => array(
>                                 'keyValues' => array(
>                                         'type' => 77,
>                                 )
>                         )
>                         , 'rss091.xml' => array(
>                                 'keyValues' => array(
>                                         'type' => 101,
>                                 )
>                         )
>                         , 'rdf.xml' => array(
>                                 'keyValues' => array(
>                                         'type' => 102,
>                                 )
>                         )
>                         , 'atom.xml' => array(
>                                 'keyValues' => array(
>                                         'type' => 103,
>                                 )
>                         )
>                         , 'robots.txt' => array(
> 
>               'keyValues' => array(
>                                         'type' => 201,
>                                                 )
>                                 )
>                         ,'sitemap.xml' => array(
>                                 'keyValues' => array(
>                                         'type' => 200,
>                                 ),
>         )
>                 )
>                 , 'defaultToHTMLsuffixOnPrev' => 1
>                 , 'acceptHTMLsuffix' => 1
>         )
> );
> 
> 
> /* ----------  ADD CONFIGS BELOW THIS LINE ---------- */
> 
> /* Copy the _DEFAULT config for all domains */
> $TYPO3_CONF_VARS['EXTCONF']['realurl']['www.domain1.de']  = 
> $TYPO3_CONF_VARS['EXTCONF']['realurl']['_DEFAULT'];
> $TYPO3_CONF_VARS['EXTCONF']['realurl']['www.domain1.com'] = 
> $TYPO3_CONF_VARS['EXTCONF']['realurl']['_DEFAULT'];
> $TYPO3_CONF_VARS['EXTCONF']['realurl']['www.domain1.gr']  = 
> $TYPO3_CONF_VARS['EXTCONF']['realurl']['_DEFAULT'];
> $TYPO3_CONF_VARS['EXTCONF']['realurl']['www.domain2.com']  = 
> $TYPO3_CONF_VARS['EXTCONF']['realurl']['_DEFAULT'];
> 
> 
> /* Set rootpage_id for each domains, and other specific configurations 
*/
> 
> $TYPO3_CONF_VARS['EXTCONF']['realurl']['www.domain1.de']
> ['pagePath']['rootpage_id']  = 1;
> $TYPO3_CONF_VARS['EXTCONF']['realurl']['www.domain1.com']
> ['pagePath']['rootpage_id'] = 1;
> $TYPO3_CONF_VARS['EXTCONF']['realurl']['www.domain1.gr']
> ['pagePath']['rootpage_id']  = 1;
> $TYPO3_CONF_VARS['EXTCONF']['realurl']['www.domain2.com
> ']['pagePath']['rootpage_id'] = 143;
> 
> 
> /* Default/available languages for each sites */
> // note : domain1 doesn't need prevars /en /de or /gr in the url, it 
uses 
> distinct domains for language switch instead
> //$TYPO3_CONF_VARS['EXTCONF']['realurl']['www.domain1.de
> ']['preVars']['0']['valueMap']['de']  = 0;
> //$TYPO3_CONF_VARS['EXTCONF']['realurl']['www.domain1.
> com']['preVars']['0']['valueMap']['en'] = 1;
> //$TYPO3_CONF_VARS['EXTCONF']['realurl']['www.domain1.
> gr']['preVars']['0']['valueMap']['gr']  = 2; 
> 
> $TYPO3_CONF_VARS['EXTCONF']['realurl']['www.domain2.
> com']['preVars']['0']['valueMap']['en'] = 1;
> $TYPO3_CONF_VARS['EXTCONF']['realurl']['www.domain2.com
> ']['preVars']['0']['valueMap']['gr']  = 2;
> 
> 
> 
> $TYPO3_CONF_VARS'['EXTCONF']['realurl']['www.domain1.com']' = array( 
>          'encode' => array( 
>                  array( 
>                          'GETvar' => 'L', 
>                          'value' => '0', 
>                          'useConfiguration' => '_DEFAULT', 
>                          'urlPrepend' => 'http://www.domain1.de'
>                  ), 
>                  array( 
>                          'GETvar' => 'L', 
>                          'value' => '1', 
>                          'useConfiguration' => '_DEFAULT', 
>                          'urlPrepend' => 'http://www.domain1.com'
>                  ), 
>                  array( 
>                          'GETvar' => 'L', 
>                          'value' => '2', 
>                          'useConfiguration' => '_DEFAULT', 
>                          'urlPrepend' => 'http://www.domain1.gr'
>                  ), 
>          ), 
>          'decode' => array( 
>                  'www.domain1.de' => array( 
>                          'GETvars' => array( 
>                                  'L' => '0', 
>                          ), 
>                          'useConfiguration' => '_DEFAULT' 
>                  ), 
>                  'www.domain1.com' => array( 
>                          'GETvars' => array( 
>                                  'L' => '1', 
>                          ), 
>                          'useConfiguration' => '_DEFAULT' 
>                  ), 
>                  'www.domain1.gr' => array( 
>                          'GETvars' => array( 
>                                  'L' => '2', 
>                          ), 
>                          'useConfiguration' => '_DEFAULT' 
>                  ), 
>          ), 
> ); 
> 
> $TYPO3_CONF_VARS'['EXTCONF']['realurl']['www.domain1.de'] = 
> $TYPO3_CONF_VARS'['EXTCONF']['realurl']['www.domain1.com'];
> 
> $TYPO3_CONF_VARS'['EXTCONF']['realurl']['www.domain1.gr'] = 
> $TYPO3_CONF_VARS'['EXTCONF']['realurl']['www.domain1.com'];
> 
> 
> /* There is one important issue with using _DEFAULT in multi-domain 
> environment. 
> When RealURL searches for domains, it does walks domains in the 
> configuration sequentally until the first match. _DEFAULT matches 
always. 
> It means that if any domain is placed after _DEFAULT, it will never be 
> reached. Remember that! But better avoid using _DEFAULT at all in 
> multi-domain configuration.  */
>   unset($TYPO3_CONF_VARS['EXTCONF']['realurl']['_DEFAULT']);
> 
> 
> ?> 
> 
> 
> 
> I've set the configs with the info you said in previous emails, in 
theory, 
> you should only need to edit domain names below the line and you should 
be 
> good to go. 
> 
> 
> 
> 
> typo3-english-bounces at lists.typo3.org a écrit sur 2013-04-24 03:55:10 :
> 
> > De : Michaela <m.herzhauser at gmx.de>
> > A : typo3-english at lists.typo3.org
> > Date : 2013-04-24 04:14
> > Objet : [TYPO3-english]  Re: realurl configuration for different 
> > multilanguage domains
> > Envoyé par : typo3-english-bounces at lists.typo3.org
> > 
> > Hello Jean-Sebastien,
> > 
> > thank you for your reply and for these very helpful explanation from 
> Dmitry.
> > 
> > As advised I created a common base for alle domains:
> > 
> > ___________________
> > 
> > $tx_realurl_config = array(...);
> > 
> > $TYPO3_CONF_VARS'['EXTCONF']['realurl']' = array(
> >   'www.domain1.tld' => $tx_realurl_config,
> >   'www.domain2.tld' => $tx_realurl_config,
> > );
> > 
> > $TYPO3_CONF_VARS'= 1;
> > $TYPO3_CONF_VARS'['EXTCONF']['realurl']['www.domain2.tld']
> > ['pagePath']['rootpage_id']' = 143
> > 
> > ___________________
> > 
> > So far it works fine! But:
> > Where do I put that _DOMAIN array? 
> > As soon as I use _DOMAINS domain2 receive the url from domain1, 
> > because they have all the same language parameters.
> > 
> > 
> > $TYPO3_CONF_VARS'['EXTCONF']['realurl']['_DOMAINS']' = array( 
> > 'encode' => array(...), 
> > 'decode' => array(...), 
> > );
> > 
> > I tried several configurations but unfortunately I don't know how to
> > set the _DOMAINS array in combination whith other domains.
> > 
> > Thanks.
> > Michaela
> > _______________________________________________
> > TYPO3-english mailing list
> > TYPO3-english at lists.typo3.org
> > http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-english
> _______________________________________________
> TYPO3-english mailing list
> TYPO3-english at lists.typo3.org
> http://lists.typo3.org/cgi-bin/mailman/listinfo/typo3-english


More information about the TYPO3-english mailing list