---
title: "realurl subdomain configuration?"
url: "https://www.typo3.net/d/89722-realurl-subdomain-configuration"
source: "typo3.net"
tags: ["Extensions","Frage","RealURL","URLs & Routing"]
created: "2009-05-14"
last_reply: "2009-05-20"
replies: 2
solved: false
page: 1
pages: 1
lang: "de"
---

# realurl subdomain configuration?

Extensions · 2 Antworten · gestartet 2009-05-14

## Eröffnungsbeitrag

**Rupali** · 2009-05-14 · [Beitrag #1](https://www.typo3.net/d/89722-realurl-subdomain-configuration/1)

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
<?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

## Antworten

### [#2](https://www.typo3.net/d/89722-realurl-subdomain-configuration/2) · marmu · 2009-05-20

einmal als default definieren:

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

und danach die einzelnen Domains und rootpage_ids zuweisen:

```php
$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;
```

### [#3](https://www.typo3.net/d/89722-realurl-subdomain-configuration/3) · Rupali · 2009-05-20

Danke!
Hat funktioniert :)

---

Quelle: „realurl subdomain configuration?“, typo3.net, https://www.typo3.net/d/89722-realurl-subdomain-configuration
Beiträge von Mitgliedern des Forums. Bitte mit Link auf die Diskussion zitieren.
