Hier werden die Unterschiede zwischen zwei Versionen der Seite angezeigt.
Beide Seiten, vorherige ÜberarbeitungVorherige ÜberarbeitungNächste Überarbeitung | Vorherige Überarbeitung | ||
typo3:realurl [2015/02/12 17:56] – [Automatische Konfiguration von RealURL] admin | typo3:realurl [2018/06/19 18:49] (aktuell) – [Defaultsprache immer mit Sprachkürzel in URL] admin | ||
---|---|---|---|
Zeile 1: | Zeile 1: | ||
- | ===== RealURL ===== | + | ====== RealURL ====== |
+ | |||
+ | ===== Einrichtung ===== | ||
- RealURL installieren | - RealURL installieren | ||
- TypoScript ergänzen | - TypoScript ergänzen | ||
- Konfiguration anlegen (realurl_conf.php) | - Konfiguration anlegen (realurl_conf.php) | ||
- | - .htaccess | + | - .htaccess |
==== TypoScript ==== | ==== TypoScript ==== | ||
- | - **baseURL:** Setzt ein '' | + | - **absRefPrefix:** Stellt allen in TYPO3 generierten Links den gesetzten String voran, in diesem Beispiel |
- **prefixLocalAnchors: | - **prefixLocalAnchors: | ||
- **simulateStaticDocuments: | - **simulateStaticDocuments: | ||
Zeile 15: | Zeile 19: | ||
<code typoscript> | <code typoscript> | ||
config { | config { | ||
- | baseURL | + | absRefPrefix |
- | prefixLocalAnchors = all | + | prefixLocalAnchors = all |
- | simulateStaticDocuments = 0 | + | simulateStaticDocuments = 0 |
- | tx_realurl_enable = 1 | + | tx_realurl_enable = 1 |
} | } | ||
</ | </ | ||
+ | |||
+ | Das früher gesetzte ''< | ||
==== 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[' | ||
</ | </ | ||
- | ==== .htacess | + | ==== .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 371: | Zeile 418: | ||
Einen manuellen Pfad stellt man am besten über die Seiteneigenschaften ein, wo nach Installation von RealURL das neue Feld '' | Einen manuellen Pfad stellt man am besten über die Seiteneigenschaften ein, wo nach Installation von RealURL das neue Feld '' | ||
+ | |||
==== Automatische Konfiguration von RealURL ==== | ==== Automatische Konfiguration von RealURL ==== | ||
- | Wenn 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 ==== | ||
Zeile 388: | Zeile 436: | ||
# Seiten-IDs: | # Seiten-IDs: | ||
' | ' | ||
+ | ), | ||
+ | </ | ||
+ | |||
+ | ==== 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 '' | ||
+ | Zudem werden die lokalisierten Inhalte auf einer Seite mit dem Namen " | ||
+ | |||
+ | <code php> | ||
+ | <?php | ||
+ | |||
+ | if (!defined(' | ||
+ | |||
+ | if (preg_match('/ | ||
+ | $GLOBALS[' | ||
+ | } else { | ||
+ | $GLOBALS[' | ||
+ | } | ||
+ | |||
+ | ?> | ||
+ | </ | ||
+ | |||
+ | Quelle: http:// | ||
+ | |||
+ | ==== Defaultsprache immer mit Sprachkürzel in URL ==== | ||
+ | |||
+ | Hierfür muss '' | ||
+ | Über TypoScript wird der GET-Parameter '' | ||
+ | |||
+ | **Typoscript: | ||
+ | <code typoscript> | ||
+ | config.defaultGetVars.L = 0 | ||
+ | </ | ||
+ | |||
+ | **realurl_conf.php (Auszug):** | ||
+ | <code php> | ||
+ | ' | ||
+ | array( | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ' | ||
+ | ), | ||
+ | // ' | ||
+ | ' | ||
+ | ), | ||
), | ), | ||
</ | </ |