Typo3 - RealURL mit mehreren Domains: Unterschied zwischen den Versionen
| Zeile 61: | Zeile 61: | ||
Es muss für jeden Domain-Record ein $TYPO3_CONF_VARS['EXTCONF']['realurl'][..] erstellt werden. | Es muss für jeden Domain-Record ein $TYPO3_CONF_VARS['EXTCONF']['realurl'][..] erstellt werden. | ||
| + | |||
| + | == Beispiel mygmk == | ||
| + | |||
| + | <pre> | ||
| + | |||
| + | $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl'] = array ( | ||
| + | '_DEFAULT'=>array( | ||
| + | 'init' => array ( | ||
| + | 'enableCHashCache' => '1', | ||
| + | 'appendMissingSlash' => 'ifNotFile', | ||
| + | 'enableUrlDecodeCache' => '1', | ||
| + | 'enableUrlEncodeCache' => '1', | ||
| + | ), | ||
| + | 'redirects' => array ( | ||
| + | ), | ||
| + | 'preVars' => array ( | ||
| + | '0' => array ( | ||
| + | 'GETvar' => 'no_cache', | ||
| + | 'valueMap' => array ( | ||
| + | 'nc' => '1', | ||
| + | ), | ||
| + | 'noMatch' => 'bypass' | ||
| + | ), | ||
| + | '1' => array ( | ||
| + | 'GETvar' => 'L', | ||
| + | 'valueMap' => array ( | ||
| + | 'de' => '0', | ||
| + | 'en' => '1', | ||
| + | ), | ||
| + | 'noMatch' => 'bypass', | ||
| + | ), | ||
| + | '2' => array ( | ||
| + | 'GETvar' => 'lang', | ||
| + | 'valueMap' => array ( | ||
| + | 'de' => 'de', | ||
| + | 'en' => 'en', | ||
| + | ), | ||
| + | 'noMatch' => 'bypass', | ||
| + | ), | ||
| + | ), | ||
| + | 'pagePath' => array ( | ||
| + | 'type' => 'user', | ||
| + | 'userFunc' => 'EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main', | ||
| + | 'spaceCharacter' => '-', | ||
| + | 'languageGetVar' => 'L', | ||
| + | 'expireDays' => '7', | ||
| + | 'rootpage_id' => '0', | ||
| + | 'firstHitPathCache'=>1, | ||
| + | ), | ||
| + | 'fixedPostVars' => array ( | ||
| + | ), | ||
| + | 'postVarSets' => array ( | ||
| + | '_DEFAULT' => array ( | ||
| + | 'archive' => array ( | ||
| + | '0' => array ( | ||
| + | 'GETvar' => 'tx_ttnews[year]', | ||
| + | ), | ||
| + | '1' => array ( | ||
| + | 'GETvar' => 'tx_ttnews[month]', | ||
| + | 'valueMap' => array ( | ||
| + | 'january' => '01', | ||
| + | 'february' => '02', | ||
| + | 'march' => '03', | ||
| + | 'april' => '04', | ||
| + | 'may' => '05', | ||
| + | 'june' => '06', | ||
| + | 'july' => '07', | ||
| + | 'august' => '08', | ||
| + | 'september' => '09', | ||
| + | 'october' => '10', | ||
| + | 'november' => '11', | ||
| + | 'december' => '12', | ||
| + | ), | ||
| + | ), | ||
| + | ), | ||
| + | 'browse' => array ( | ||
| + | '0' => array ( | ||
| + | 'GETvar' => 'tx_ttnews[pointer]', | ||
| + | ), | ||
| + | ), | ||
| + | 'select_category' => array ( | ||
| + | '0' => array ( | ||
| + | 'GETvar' => 'tx_ttnews[cat]', | ||
| + | ), | ||
| + | ), | ||
| + | 'article' => array ( | ||
| + | '0' => 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' => '-', | ||
| + | ), | ||
| + | ), | ||
| + | ), | ||
| + | '1' => array ( | ||
| + | 'GETvar' => 'tx_ttnews[swords]', | ||
| + | ), | ||
| + | ), | ||
| + | ), | ||
| + | ), | ||
| + | 'fileName' => array ( | ||
| + | // | ||
| + | // if you don't want .html-URLs set the following to "false" (e.g. 'defaultToHTMLsuffixOnPrev' => false,) | ||
| + | // then you get http://www.yourdomain.com/imprint/ instead of http://www.yourdomain.com/imprint.html | ||
| + | // | ||
| + | 'defaultToHTMLsuffixOnPrev' => true, | ||
| + | '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', | ||
| + | ), | ||
| + | ), | ||
| + | ), | ||
| + | ), | ||
| + | ), | ||
| + | ); | ||
| + | $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['www.mygmk.de'] = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['_DEFAULT']; | ||
| + | $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['www.mygmk.de']['pagePath']['rootpage_id'] = 1; | ||
| + | $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['www.siedlevoss.de'] = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['_DEFAULT']; | ||
| + | $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['www.siedlevoss.de']['pagePath']['rootpage_id'] = 103; | ||
| + | $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['www.vanderrolle.de'] = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['_DEFAULT']; | ||
| + | $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['www.vanderrolle.de']['pagePath']['rootpage_id'] = 133; | ||
| + | |||
| + | </pre> | ||
Aktuelle Version vom 3. März 2011, 14:15 Uhr
Quelle: http://www.seo24.at/realurl-mehrere-domains/ Zugriff am 29.1.2009
Mehre Domain-Records und unerwünschte erzeugte URLs[Bearbeiten]
Von Armin Bartsch
Werden mehrere Domain-Records für eine Seite angelegt oder mehrere Seiten kann es zur Erzeugung unerwünschter URLs kommen Standard-Konfiguration
Erfolgt keine Konfiguration von realurl greift eine Standard-Konfiguration, die Ausgabe erfolgt als domain/Seiten-uid.
Meist wird die Ausgabe von relaurl aber besonders konfiguriert um eine benutzer- und suchmaschinenfreundliche URL zu erhalten. Dazu wird der Array
$TYPO3_CONF_VARS['EXTCONF']['realurl'][..]
gefüllt. Konfigurationsmöglichkeiten für realurl sind direkt im Extension Manual von real zu finden.
['_DEFAULT'][Bearbeiten]
Um die Basiskonfiguration von realurl zu überschreiben nutzt man den Array
$TYPO3_CONF_VARS['EXTCONF']['realurl']['_DEFAULT'] = array()
Gefüllt wird der Array mit den gewünschten Konfigurationsmöglichkeiten von realur. Verwendung
Der Einsatz von _DEFAULT ist ratsam, wenn die Standardkonfiguration von realurl überschrieben werden soll oder mehrere Domain-Records für eine Seite vorhanden sind.
Sind mehrere Seiten vorhanden, die alle die gleiche _DEFAULT Konfiguration besitzen sollen, ist es notwendig, dass die Konfigurationsvariable rootpage_id angepasst wird. Das erreicht man durch eine kleine Anpassung.
// Domain ohne www. eintragen
$rootpage_id = array(
'domain_seite1.de' => '677',
'domain_seite2.de' => '1'
);
$http_host_realurl = $rootpage_id[preg_replace('!^(www\.)!', '', $_SERVER['HTTP_HOST'])];
$TYPO3_CONF_VARS['EXTCONF']['realurl']['_DEFAULT'] = array()
Und im Konfigurationsarray wird die Variable $rootpage_id in den key rootpage_id kopiert. 'rootpage_id' => $http_host_realurl ['domain.de']
Anstatt mit _DEFAULT eine Standardkonfiguration festzulegen, kann auch eine domainabhängige Konfiguration erstellt werden.
$TYPO3_CONF_VARS['EXTCONF']['realurl']['domain.de'] = array()
Verwendung
Wenn mehrere Seiten vorhanden sind und diese unterschiedliche Konfigurationen besitzen sollen muss die $TYPO3_CONF_VARS['EXTCONF']['realurl'] mit der jeweiligen Domain angelegt werden.
Wichtig ist, dass der key 'rootpage_id' angepasst wird.
Unerwünschte erzeugte URLs[Bearbeiten]
Unerwünschte URLs werden erzeugt, wenn die Standardkonfiguration von realurl greift. Das ist meistens der Fall, wenn mehrere Domain-Records angelegt werden aber nicht für jeden Domain-Record eine Konfiguration zur Verfügung gestellt wird.
Entweder wird die Standardkonfiguration mit ['_DEFAULT'] überschrieben, das ist aber nur möglich, wenn alle Seiten/Domain-Records die gleiche Konfiguration erhalten sollen.
Eine weitere Lösungsmöglichkeit ist das Kopieren der Konfiguration für die Domain-Records.
$TYPO3_CONF_VARS['EXTCONF']['realurl']['domain.de'] = $TYPO3_CONF_VARS['EXTCONF']['realurl']['www.domain.de'];
Es muss für jeden Domain-Record ein $TYPO3_CONF_VARS['EXTCONF']['realurl'][..] erstellt werden.
Beispiel mygmk[Bearbeiten]
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl'] = array (
'_DEFAULT'=>array(
'init' => array (
'enableCHashCache' => '1',
'appendMissingSlash' => 'ifNotFile',
'enableUrlDecodeCache' => '1',
'enableUrlEncodeCache' => '1',
),
'redirects' => array (
),
'preVars' => array (
'0' => array (
'GETvar' => 'no_cache',
'valueMap' => array (
'nc' => '1',
),
'noMatch' => 'bypass'
),
'1' => array (
'GETvar' => 'L',
'valueMap' => array (
'de' => '0',
'en' => '1',
),
'noMatch' => 'bypass',
),
'2' => array (
'GETvar' => 'lang',
'valueMap' => array (
'de' => 'de',
'en' => 'en',
),
'noMatch' => 'bypass',
),
),
'pagePath' => array (
'type' => 'user',
'userFunc' => 'EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main',
'spaceCharacter' => '-',
'languageGetVar' => 'L',
'expireDays' => '7',
'rootpage_id' => '0',
'firstHitPathCache'=>1,
),
'fixedPostVars' => array (
),
'postVarSets' => array (
'_DEFAULT' => array (
'archive' => array (
'0' => array (
'GETvar' => 'tx_ttnews[year]',
),
'1' => array (
'GETvar' => 'tx_ttnews[month]',
'valueMap' => array (
'january' => '01',
'february' => '02',
'march' => '03',
'april' => '04',
'may' => '05',
'june' => '06',
'july' => '07',
'august' => '08',
'september' => '09',
'october' => '10',
'november' => '11',
'december' => '12',
),
),
),
'browse' => array (
'0' => array (
'GETvar' => 'tx_ttnews[pointer]',
),
),
'select_category' => array (
'0' => array (
'GETvar' => 'tx_ttnews[cat]',
),
),
'article' => array (
'0' => 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' => '-',
),
),
),
'1' => array (
'GETvar' => 'tx_ttnews[swords]',
),
),
),
),
'fileName' => array (
//
// if you don't want .html-URLs set the following to "false" (e.g. 'defaultToHTMLsuffixOnPrev' => false,)
// then you get http://www.yourdomain.com/imprint/ instead of http://www.yourdomain.com/imprint.html
//
'defaultToHTMLsuffixOnPrev' => true,
'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',
),
),
),
),
),
);
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['www.mygmk.de'] = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['_DEFAULT'];
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['www.mygmk.de']['pagePath']['rootpage_id'] = 1;
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['www.siedlevoss.de'] = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['_DEFAULT'];
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['www.siedlevoss.de']['pagePath']['rootpage_id'] = 103;
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['www.vanderrolle.de'] = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['_DEFAULT'];
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['www.vanderrolle.de']['pagePath']['rootpage_id'] = 133;