why realurl sucks - and how to fix it
DESCRIPTION
RealURL ist eine der meistgenutzten Erweiterungen für TYPO3. Viele Anwender sind jedoch schon an der Konfiguration verzweifelt. Hier sind die Folien zu einem Vortrag anlässlich der TYPO3 Akademie 2011, der sich mit dem Thema RealURL befasstTRANSCRIPT
Why RealURL sucks...(and how to fix it)
TYPO3 Akademie 2011
Montag, 28. Februar 2011
RealURL
• ist fantastisch
• ist extrem flexibel
• ABER ....!
Montag, 28. Februar 2011
Was ist das Problem?
Folie 3 von 3786
Montag, 28. Februar 2011
50 Bugfixes in 6 Monaten
Montag, 28. Februar 2011
Montag, 28. Februar 2011
Warum RealURL ?
• 'Lesbare' URLs
• für Menschen
• für Suchmaschinen
Montag, 28. Februar 2011
SimulateStatic
• Home -> Produkte -> TV -> LCD
[domain]/lcd.html
• Home -> Impressum
[domain]/impressum.html
Montag, 28. Februar 2011
Installation
• Konfigurationsdatei:
Montag, 28. Februar 2011
Installation
• Automatische Konfiguration:
typo3conf/realurl_autoconf.php
• Achtung:wird gelöscht bei Anlegen eines Domain-Records!
Montag, 28. Februar 2011
Installation
Montag, 28. Februar 2011
SpeicherformatSerialized:$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']=unserialize('a:1:{s:8:"_DEFAULT";a:4:{s:4:"init";a:7:{s:16:"enableCHashCache"....
Source (slow?!):$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']=array ( '_DEFAULT' => array ( 'init' => array ( 'enableCHashCache' => true, 'appendMissingSlash' => 'ifNotFile,redirect', 'adminJumpToBackend' => true, 'enableUrlDecodeCache' => true, ....
Montag, 28. Februar 2011
ohne Konfiguration
• [domain]/index.php?id=123
• [domain]/123/
• [domain]/alias/
Montag, 28. Februar 2011
Autokonfiguration
• [domain]/index.php?id=123
• [domain]/seitentitel/
• [domain]/navigationstitel/
• [domain]/alias/
Montag, 28. Februar 2011
Autokonfiguration
• Nur für Basis-Konfiguration ohne Extensions mit GET Variablen
Montag, 28. Februar 2011
Montag, 28. Februar 2011
/datei-downloads/software/windows/windows-xp.html
/datei-downloads/software/windows/windows-xp.html
/datei-downloads/programme.html/datei-downloads/programme/windows.html/datei-downloads/programme/windows/windows-xp.html
Montag, 28. Februar 2011
/abc/programme.html/abc/programme/windows.html/abc/programme/windows/windows-xp.html
Montag, 28. Februar 2011
/datei-downloads/software.html/datei-downloads/windows.html/datei-downloads/windows/windows-xp.html
Montag, 28. Februar 2011
Funktionsweise RealURL
• Seiten ID + Parameter -> URL
• URL -> Seiten ID + Parameter
Montag, 28. Februar 2011
Teile der URLDomain www.test.de
preVars en
pagePath shop/products/
fixedPostVars create
postVarSets article/123/color
fileName detail.html
Montag, 28. Februar 2011
Kodierung
Überschriften ueberschriften
Académie française academie-francaise
Español espanol
Фотосессия fotosessija
Ελλάδα ellada
מדינת ישראל mdint-ishral
Montag, 28. Februar 2011
Multi Domain[www.domain1.de] => array ( ... ),
[www.domain1.de] => array ( ... ),
[_DEFAULT] => array ( ... ),
Montag, 28. Februar 2011
Multi Domain[_DEFAULT] => array ( ... ),
[www.domain1.de] => array ( ... ),
[www.domain2.de] => array ( ... ),
Montag, 28. Februar 2011
Konfiguration[domain]
init => array (...),redirects => array (...),redirects_regex => array (...),preVars => array (...),pagePath => array (...),fixedPostVars => array (...),postVarSets => array (...)fileName => array (...)
Montag, 28. Februar 2011
init 'enableCHashCache' => true, 'appendMissingSlash' => 'ifNotFile,redirect', 'adminJumpToBackend' => true, 'enableUrlDecodeCache' => true, 'enableUrlEncodeCache' => true, 'emptyUrlReturnValue' => '/', 'respectSimulateStaticURLs' => true,
Montag, 28. Februar 2011
'doNotRawUrlEncodeParameterNames' => true,
• tx_ttnews%5Btt_news%5D=3
wird zu
• tx_ttnews[tt_news]=3
init
Montag, 28. Februar 2011
'enableAllUnicodeLetters' => true,
• ermöglicht URLs in der Form
http://name-der-domain.de/普通話/
init
Montag, 28. Februar 2011
'postVarSet_failureMode' => 'redirect_goodUpperDir',
init
Montag, 28. Februar 2011
'postVarSet_failureMode' => 'ignore',
init
Montag, 28. Februar 2011
Montag, 28. Februar 2011
redirects
'redirects' =>. array ( 'aktuelles/' => '301;http://spiegel.de', ),
Montag, 28. Februar 2011
redirects_regex
'redirects_regex' =>. array ( '^english/(.*)' => '301;en/\1',
'^downloads/(.*)' => 'ftp://dl.domain.tld/public/dl/\1', ),
Montag, 28. Februar 2011
Teile der URLDomain www.test.de
preVars en
pagePath shop/products/
fixedPostVars create
postVarSets article/123/color
fileName detail.html
Montag, 28. Februar 2011
preVars
• http://[domain]/en/news/articel.html
Montag, 28. Februar 2011
preVars'preVars' => array ( 0 => array ( 'GETvar' => 'L', 'valueMap' =>. array ( 'en' => '1', ), 'noMatch' => 'bypass', ), ),
Montag, 28. Februar 2011
preVars
1. Prüfe ob Eintrag in valueMap2. Falls nicht gefunden, setze noMatch3. Prüfe Eintrag in noMatch- 'bypass': Wert wird nicht gesetzt, fortfahren- 'null': Wert wird nicht gesetzt, ignoriere Rest4. Datenbankabruf mit 'lookUpTable'5. Verarbeitung mit 'userFunc'6. Setze Wert mit 'valueDefault'
Montag, 28. Februar 2011
'lookUpTable' => array( 'table' => 'tt_news', 'id_field' => 'uid', 'alias_field' => 'title', 'maxLength' => 50, 'useUniqueCache' => 1, 'useUniqueCache_conf' => array ( 'strtolower' => '1'. 'spaceCharacter' => '-', 'encodeTitle_userProc' => '...' ) 'addWhereClause' => ' AND NOT deleted', 'languageGetVar' => 'L', 'languageExceptionUids' => '', 'languageField' => 'sys_language_uid', 'transOrigPointerField' => 'l18n_parent', 'enable404forInvalidAlias' => '1', 'autoUpdate' => '1', 'expireDays' => '60')
Montag, 28. Februar 2011
Teile der URLDomain www.test.de
preVars en
pagePath shop/products/
fixedPostVars create
postVarSets article/123/color
fileName detail.html
Montag, 28. Februar 2011
pagePath
'pagePath' => array( 'type' => 'user', 'userFunc' => 'EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main',
'spaceCharacter' => '-', 'languageGetVar' => 'L', 'expireDays' => 30),
Montag, 28. Februar 2011
Teile der URLDomain www.test.de
preVars en
pagePath shop/products/
fixedPostVars create
postVarSets article/123/color
fileName detail.html
Montag, 28. Februar 2011
postVarSetsfixedPostVars
postVarsSets => array ('123' => array (...),'_DEFAULT' => array (...),
),
Montag, 28. Februar 2011
postVarSets
postVarsSets => array ('_DEFAULT' => array (
'news' => array (...),'calendar' => array (...),'shop' => array (...),
),),
Montag, 28. Februar 2011
postVarSetspostVarsSets => array (
'_DEFAULT' => array ('news' => array ('list' => array (...),'single' => array (...),'archive' => array (...),
),),
),Montag, 28. Februar 2011
'postVarSets' => array( '_DEFAULT' => array( // news archive parameters 'archive' => array( array( 'GETvar' => 'tx_ttnews[year]' , ), 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', ) ), ),
Montag, 28. Februar 2011
Teile der URLDomain www.test.de
preVars en
pagePath shop/products/
fixedPostVars create
postVarSets article/123/color
fileName detail.html
Montag, 28. Februar 2011
fileName 'fileName' => array( 'defaultToHTMLsuffixOnPrev' => '1', 'acceptHTMLsuffix' => '1', 'index' => array( 'rss.xml' => array( 'keyValues' => array( 'type' => 100, ), ), '.pdf' => array( 'keyValues' => array( 'type' => 123, ), ), 'print.html' => array( 'keyValues' => array( 'type' => 98, ), ), ), ),
Montag, 28. Februar 2011