Zum Inhalt springen

realurl subdomain configuration?

Erstellt am 14. Mai 2009 · 2 Antworten · letzte Antwort am 20. Mai 2009

Tags: Frage

Rupali ·

Hallo List,

Ich wollte nur fragen wie man subdomain configuration in realurlconf.php richtig schreibt ?
momentan habe ich 2 domain. für der erste habe ich bereits folgendes :

<?php
$TYPO3_CONF_VARS['EXTCONF']['realurl']['www.domain1.com'] = array(
        'init' => array(
            'enableCHashCache' => 1,
            'appendMissingSlash' => 'redirect',
            'enableUrlDecodeCache' => 1,
            'enableUrlEncodeCache' => 1,
            'respectSimulateStaticURLs' => 0,
            'postVarSet_failureMode'=>'redirect_goodUpperDir',
        ),
    'redirects_regex' => array (

    ),
    'preVars' => array(
                        array(
                                'GETvar' => 'no_cache',
                                'valueMap' => array(
                                    'no_cache' => 1,
                                ),
                                'noMatch' => 'bypass',
                        ),
                         array(
                             'GETvar' => 'L',
                             'valueMap' => array( 						
                                                'en' => '0', 
                                                'de' => '2',                                               
                                        ),
                              'valueDefault' => 'en',
                        ),
                ),
     'pagePath' => array(
            'type' => 'user',
            'userFunc' => 'EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main',
            'spaceCharacter' => '-',
            'languageGetVar' => 'L',
            'expireDays' => 7,
            'rootpage_id' => 1,
        ),


      'postVarSets' => array(
            '_DEFAULT' => array(
                // news archive parameters
                'datum' => array(
                    array(
                        'GETvar' => 'tx_ttnews[year]' ,
                        ),
                    array(
                        'GETvar' => 'tx_ttnews[month]' ,
                            'valueMap' => array(
                            'januar' => '01',
                            'february' => '02',
                            'march' => '03',
                            'april' => '04',
                            'may' => '05',
                            'june' => '06',
                            'july' => '07',
                            'august' => '08',
                            'september' => '09',
                            'october' => '10',
                            'november' => '11',
                            'december' => '12',
                            )
                        ),
                     array('GETvar' => 'tx_ttnews[day]' , ),
                    ),
                // news pagebrowser
                'browse' => array(
                    array(
                        'GETvar' => 'tx_ttnews[pointer]',
                        ),
                    ),
                // news categories
                'select_category' => array (
                    array(
                        'GETvar' => 'tx_ttnews[cat]',
                        ),
                    ),
                // news articles and searchwords
                'article' => array(
array(
          'GETvar' => 'tx_ttnews[pointer]',
          'valueMap' => array(),
          'noMatch' => 'bypass',
        ),
                    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' => '-',
                                ),
'languageGetVar' => 'L',
            'languageExceptionUids' => '',
            'languageField' => 'sys_language_uid',
            'transOrigPointerField' => 'l18n_parent',
            'autoUpdate' => 1,
            'expireDays' => 180,
                            ),
                        ),
                    array(
                        'GETvar' => 'tx_ttnews[swords]',
                        ),
                    ),
                ),
            ),

      'fileName' => array(
            'defaultToHTMLsuffixOnPrev'=> 0 ,
            'index' => array(
                'rss.xml' => array(
                    'keyValues' => array(
                        'type' => 100,
                    ),
                ),
                'rss091.xml' => array(
                    'keyValues' => array(
                        'type' => 101,
                    ),
                ),
                'rdf.xml' => array(
                    'keyValues' => array(
                        'type' => 102,
                    ),
                ),
                'atom.xml' => array(
                    'keyValues' => array(
                        'type' => 103,
                    ),
                ),
            ),
        ),
 );
 php?>

funktioniert auch super, für den zweite domain habe ich auch den gleiche code am ende rein gemacht (domain name und root page id configuriert.)
so weit so gut, alle beide funktionieren super.
nun finde ich diese Methode nicht so gut, da für jeder subdomain kopiere ich den ganzen code und füge es am ende ein.

Gibt's besser Lösung dafür ?

Danke und Grüße,
Rupali

marmu ·

einmal als default definieren:

$TYPO3_CONF_VARS['EXTCONF']['realurl']['_DEFAULT'] = array(
... )

und danach die einzelnen Domains und rootpage_ids zuweisen:

$TYPO3_CONF_VARS['EXTCONF']['realurl']['www.domain1.de'] = $TYPO3_CONF_VARS['EXTCONF']['realurl']['_DEFAULT'];
$TYPO3_CONF_VARS['EXTCONF']['realurl']['www.domain1.de']['pagePath']['rootpage_id'] = 1;
$TYPO3_CONF_VARS['EXTCONF']['realurl']['www.domain2.de'] = $TYPO3_CONF_VARS['EXTCONF']['realurl']['_DEFAULT'];
$TYPO3_CONF_VARS['EXTCONF']['realurl']['www.domain2.de']['pagePath']['rootpage_id'] =2;