Hier werden die Unterschiede zwischen zwei Versionen der Seite angezeigt.
Beide Seiten, vorherige ÜberarbeitungVorherige ÜberarbeitungNächste Überarbeitung | Vorherige Überarbeitung | ||
typo3:realurl [2017/11/14 20:18] – [absRefPrefix] admin | typo3:realurl [2018/06/19 18:49] (aktuell) – [Defaultsprache immer mit Sprachkürzel in URL] admin | ||
---|---|---|---|
Zeile 7: | Zeile 7: | ||
- TypoScript ergänzen | - TypoScript ergänzen | ||
- Konfiguration anlegen (realurl_conf.php) | - Konfiguration anlegen (realurl_conf.php) | ||
- | - .htaccess | + | - .htaccess |
==== TypoScript ==== | ==== TypoScript ==== | ||
Zeile 29: | Zeile 30: | ||
==== realurl_conf.php ==== | ==== realurl_conf.php ==== | ||
- | Die Datei wird in den Ordner '' | + | Die Datei wird in den Ordner '' |
- | === RealURL + News System (news) === | + | === RealURL |
<code php realurl_conf.php> | <code php realurl_conf.php> | ||
<?php | <?php | ||
- | $TYPO3_CONF_VARS[' | + | $GLOBALS[' |
- | $TYPO3_CONF_VARS[' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ), | + | |
- | ), | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ), | + | |
- | ), | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ), | + | |
- | ), | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ), | + | |
- | ), | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ), | + | |
- | ), | + | |
- | ), | + | |
- | ), | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ), | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ), | + | |
- | ' | + | |
- | array( | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ), | + | |
- | ' | + | |
- | ), | + | |
- | array( | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ), | + | |
- | ' | + | |
- | ), | + | |
- | ), | + | |
- | ' | + | |
- | ' | + | |
- | array( | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ), | + | |
- | ' | + | |
- | ), | + | |
- | array( | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ), | + | |
- | ' | + | |
- | ), | + | |
- | array( | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ), | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ) | + | |
- | ) | + | |
- | ), | + | |
- | ' | + | |
- | array( | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ) | + | |
- | ) | + | |
- | ) | + | |
- | ), | + | |
- | ' | + | |
- | array( | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ' | + | |
- | ) | + | |
- | ) | + | |
- | ) | + | |
- | ), | + | |
- | ' | + | |
- | // ' | + | |
- | ' | + | |
- | ' | + | |
- | ), | + | // Domain 1: |
- | ' | + | $domain1 |
- | | + | $rootPageUid1 |
- | ' | + | |
- | array( | + | |
- | ' | + | |
- | ' | + | |
- | ), | + | |
- | array( | + | |
- | ' | + | |
- | ' | + | |
- | ) | + | |
- | ), | + | |
- | ' | + | // Domain 2: |
- | | + | $domain2 |
- | ' | + | $rootPageUid2 |
- | ), | + | |
- | array( | + | |
- | ' | + | |
- | ), | + | |
- | ), | + | |
- | ' | + | |
- | array( | + | |
- | ' | + | |
- | ), | + | |
- | ), | + | |
- | ), | + | |
- | ), | + | |
- | ); | + | |
- | ?> | + | |
- | </ | + | |
- | === RealURL + News (tt_news) === | + | // Domain 3: |
- | <code php realurl_conf.php> | + | $domain3 |
- | <?php | + | $rootPageUid3 |
- | $TYPO3_CONF_VARS[' | + | |
- | $TYPO3_CONF_VARS['EXTCONF']['realurl'] = array( | + | $rssFeedPageType |
- | '_DEFAULT' => array( | + | |
- | ' | + | $GLOBALS[' |
- | ' | + | ' |
- | ' | + | ' |
- | ' | + | |
- | ' | + | 'expireDays' |
- | 'postVarSet_failureMode' => '', | + | ' |
- | ), | + | 'autoUpdatePathCache' => ' |
- | 'redirects' => array(), | + | ], |
- | 'preVars' => array( | + | ' |
- | array( | + | ' |
- | 'GETvar' => ' | + | ' |
- | 'valueMap' => array( | + | ' |
- | 'nc' => 1, | + | ' |
- | ), | + | ], |
- | 'noMatch' => 'bypass', | + | |
- | ), | + | |
- | array( | + | 'acceptHTMLsuffix' => 1, |
- | ' | + | 'index' => [ |
- | ' | + | 'feed.rss' => [ |
- | # | + | 'keyValues' => [ |
- | ' | + | 'type' => $rssFeedPageType, |
- | ), | + | ] |
- | 'valueDefault' => 'de', | + | ], |
- | 'noMatch' => 'bypass', | + | 'sitemap.xml' => [ |
- | ), | + | |
- | ), | + | ' |
- | 'pagePath' => array( | + | ], |
- | 'type' => ' | + | ], |
- | 'userFunc' => 'EXT: | + | |
- | 'spaceCharacter' => '-', | + | ] |
- | 'languageGetVar' => 'L', | + | ], |
- | 'expireDays' => 7, | + | ' |
- | 'rootpage_id' => 1, | + | [ |
- | 'firstHitPathCache' | + | ' |
- | ), | + | |
- | 'fixedPostVars' => array(), | + | // IDs of all languages and the wanted url part |
- | 'postVarSets' => array( | + | |
- | '_DEFAULT' => array( | + | // |
- | // news archive parameters | + | ' |
- | 'archive' => array( | + | ], |
- | array( | + | 'noMatch' => 'bypass', |
- | 'GETvar' => 'tx_ttnews[year]' | + | ], |
- | ), | + | [ |
- | array( | + | |
- | ' | + | 'valueMap' => [ |
- | 'valueMap' => array( | + | 'nc' => 1, |
- | 'january' => '01', | + | ], |
- | 'february' => '02', | + | |
- | 'march' => '03', | + | ], |
- | 'april' => '04', | + | ], |
- | 'may' => ' | + | |
- | 'june' => '06', | + | |
- | 'july' => '07', | + | [ |
- | 'august' => '08', | + | |
- | 'september' => '09', | + | 'valueMap' => [ |
- | 'october' => '10', | + | // |
- | 'november' => '11', | + | ], |
- | 'december' => '12', | + | 'noMatch' => ' |
- | ) | + | ], |
- | ), | + | [ |
- | ), | + | |
- | // news pagebrowser | + | 'valueMap' => [ |
- | 'browse' => array( | + | // 'News' => '', |
- | array( | + | ], |
- | ' | + | 'noMatch' => 'bypass' |
- | ), | + | ], |
- | ), | + | [ |
- | // news categories | + | ' |
- | 'select_category' => array ( | + | 'lookUpTable' => [ |
- | array( | + | 'table' => 'tx_news_domain_model_news', |
- | 'GETvar' => 'tx_ttnews[cat]', | + | 'id_field' => 'uid', |
- | ), | + | 'alias_field' => 'title', |
- | ), | + | 'addWhereClause' => ' |
- | // news articles anMd searchwords | + | 'useUniqueCache' => 1, |
- | 'article' => array( | + | 'useUniqueCache_conf' => [ |
- | array( | + | |
- | ' | + | 'spaceCharacter' => '-' |
- | ' | + | ], |
- | ' | + | 'languageGetVar' => 'L', |
- | ' | + | 'languageExceptionUids' => '', |
- | ' | + | 'languageField' => 'sys_language_uid', |
- | ' | + | 'transOrigPointerField' => 'l10n_parent', |
- | ' | + | 'autoUpdate' => 1, |
- | ' | + | |
- | ' | + | ] |
- | ' | + | ] |
- | ), | + | ], |
- | ), | + | 'newsCategoryConfiguration' => [ |
- | ), | + | [ |
- | array( | + | ' |
- | ' | + | ' |
- | ), | + | ' |
- | array( | + | ' |
- | ' | + | 'alias_field' => ' |
- | ), | + | 'addWhereClause' => ' |
- | ), | + | ' |
- | ), | + | ' |
- | ), | + | ' |
- | // configure filenames for different pagetypes | + | ' |
- | ' | + | ] |
- | ' | + | ] |
- | ' | + | ] |
- | ' | + | ], |
- | ' | + | |
- | ' | + | [ |
- | ), | + | ' |
- | ), | + | ' |
- | ' | + | ' |
- | ' | + | ' |
- | ' | + | ' |
- | ), | + | ' |
- | ), | + | ' |
- | ' | + | ' |
- | ' | + | ' |
- | ' | + | ' |
- | ), | + | ] |
- | ), | + | ] |
- | ' | + | ] |
- | ' | + | ], |
- | ' | + | ' |
- | ), | + | // ' |
- | ), | + | // ' |
- | ' | + | // ' |
- | ' | + | ], |
- | ' | + | ' |
- | ), | + | ' |
- | ), | + | // EXT:news |
- | ), | + | ' |
- | ), | + | [ |
- | ), | + | ' |
- | ); | + | ' |
- | ?> | + | ], |
+ | [ | ||
+ | ' | ||
+ | ' | ||
+ | ] | ||
+ | ], | ||
+ | |||
+ | ' | ||
+ | [ | ||
+ | ' | ||
+ | ], | ||
+ | [ | ||
+ | ' | ||
+ | ], | ||
+ | ], | ||
+ | ' | ||
+ | [ | ||
+ | ' | ||
+ | ], | ||
+ | ], | ||
+ | ], | ||
+ | | ||
+ | // | ||
+ | // | ||
+ | // | ||
+ | // ' | ||
+ | // | ||
+ | // | ||
+ | // | ||
+ | // | ||
+ | // | ||
+ | // | ||
+ | // | ||
+ | // | ||
+ | // | ||
+ | // | ||
+ | // | ||
+ | // | ||
+ | // | ||
+ | // | ||
+ | // | ||
+ | // | ||
+ | // | ||
+ | // | ||
+ | // | ||
+ | // | ||
+ | // | ||
+ | // | ||
+ | // | ||
+ | // | ||
+ | // | ||
+ | // | ||
+ | // ], | ||
+ | ], | ||
+ | ]; | ||
+ | |||
+ | // Domain 2: | ||
+ | $GLOBALS[' | ||
+ | $GLOBALS[' | ||
+ | // | ||
+ | |||
+ | // Domain 3: | ||
+ | $GLOBALS[' | ||
+ | $GLOBALS[' | ||
+ | // | ||
+ | |||
+ | |||
+ | // Local web dev environment: | ||
+ | $GLOBALS[' | ||
+ | $GLOBALS[' | ||
+ | $GLOBALS[' | ||
</ | </ | ||
==== .htaccess ==== | ==== .htaccess ==== | ||
- | .htaccess | + | Verwendet einfach die .htaccess, die im TYPO3-Core mitgeliefert wird. Diese enthält alle nötigen Konfigurationen. |
- | < | + | ---- |
- | RewriteEngine On | + | |
- | RewriteBase | + | ===== RealURL-Ergänzungen für Extensions ===== |
- | RewriteRule ^(typo3|typo3temp|typo3conf|t3lib|tslib|fileadmin|uploads|showpic\.php)/ - [L] | + | |
- | RewriteRule ^typo3$ typo3/index_re.php | + | ==== tt_news ==== |
- | RewriteCond %{REQUEST_FILENAME} !-f | + | |
- | RewriteCond %{REQUEST_FILENAME} !-d | + | **realurl_conf.php (Auszug): |
- | RewriteCond %{REQUEST_FILENAME} !-l | + | < |
- | RewriteRule .* / | + | ' |
+ | ' | ||
+ | | ||
+ | ' | ||
+ | [ | ||
+ | ' | ||
+ | ], | ||
+ | [ | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ] | ||
+ | ], | ||
+ | ], | ||
+ | |||
+ | | ||
+ | ' | ||
+ | [ | ||
+ | ' | ||
+ | ], | ||
+ | | ||
+ | // tt_news categories: | ||
+ | ' | ||
+ | [ | ||
+ | ' | ||
+ | ], | ||
+ | ], | ||
+ | // tt_news articles and searchwords: | ||
+ | ' | ||
+ | [ | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ], | ||
+ | ], | ||
+ | ], | ||
+ | | ||
+ | ' | ||
+ | ], | ||
+ | [ | ||
+ | ' | ||
+ | ], | ||
+ | ], | ||
+ | ], | ||
+ | ], | ||
</ | </ | ||
- | Quelle: http:// | + | ==== tt_products ==== |
+ | **realurl_conf.php (Auszug):** | ||
+ | <code php> | ||
+ | ' | ||
+ | // EXT: | ||
+ | [ | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ], | ||
+ | ' | ||
+ | ], | ||
+ | ], | ||
+ | ' | ||
+ | ' | ||
+ | // EXT: | ||
+ | ' | ||
+ | [ | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ] | ||
+ | ] | ||
+ | ] | ||
+ | ], | ||
+ | ' | ||
+ | [ | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ] | ||
+ | ] | ||
+ | ] | ||
+ | ], | ||
+ | ' | ||
+ | [ | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ] | ||
+ | ] | ||
+ | ] | ||
+ | ], | ||
+ | ], | ||
+ | ], | ||
+ | </ | ||
---- | ---- | ||
+ | ===== Diverses ===== | ||
==== Ordner aus Pfad entfernen ==== | ==== Ordner aus Pfad entfernen ==== | ||
Zeile 381: | Zeile 423: | ||
Falls statt der oben angegebenen die automatische Konfiguration aktiviert wurde, erstellt RealURL diese für den aktuellen Stand der TYPO3-Instanz. Werden neue Domains oder Sprachen hinzugefügt, | Falls statt der oben angegebenen die automatische Konfiguration aktiviert wurde, erstellt RealURL diese für den aktuellen Stand der TYPO3-Instanz. Werden neue Domains oder Sprachen hinzugefügt, | ||
- | ===== Einzelne Seiten von RealURL ausschließen | + | ==== Einzelne Seiten von RealURL ausschließen ==== |
<code php> | <code php> | ||
Zeile 397: | Zeile 439: | ||
</ | </ | ||
- | ===== Mehrsprachige 404-Seiten mit RealURL | + | ==== Mehrsprachige 404-Seiten mit RealURL ==== |
Eine mehrsprachige Seite sollte dem Nutzer auch eine lokalisierte Fehlermeldung ausgeben, wenn mal eine Seite nicht gefunden werden kann. Mit eingerichtetem RealURL kann folgender Code verwendet werden. Ab TYPO3 CMS 6.x muss dieser in die '' | Eine mehrsprachige Seite sollte dem Nutzer auch eine lokalisierte Fehlermeldung ausgeben, wenn mal eine Seite nicht gefunden werden kann. Mit eingerichtetem RealURL kann folgender Code verwendet werden. Ab TYPO3 CMS 6.x muss dieser in die '' | ||
Zeile 418: | Zeile 460: | ||
Quelle: http:// | Quelle: http:// | ||
- | ===== Defaultsprache immer mit Sprachkürzel in URL ===== | + | ==== Defaultsprache immer mit Sprachkürzel in URL ==== |
Hierfür muss '' | Hierfür muss '' |