why realurl sucks - and how to fix it

46
Why RealURL sucks... (and how to fix it) TYPO3 Akademie 2011 Montag, 28. Februar 2011

Upload: jweiland

Post on 24-Jun-2015

33.678 views

Category:

Technology


7 download

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 befasst

TRANSCRIPT

Page 1: Why RealURL sucks - and how to fix it

Why RealURL sucks...(and how to fix it)

TYPO3 Akademie 2011

Montag, 28. Februar 2011

Page 2: Why RealURL sucks - and how to fix it

RealURL

• ist fantastisch

• ist extrem flexibel

• ABER ....!

Montag, 28. Februar 2011

Page 3: Why RealURL sucks - and how to fix it

Was ist das Problem?

Folie 3 von 3786

Montag, 28. Februar 2011

Page 4: Why RealURL sucks - and how to fix it

50 Bugfixes in 6 Monaten

Montag, 28. Februar 2011

Page 5: Why RealURL sucks - and how to fix it

Montag, 28. Februar 2011

Page 6: Why RealURL sucks - and how to fix it

Warum RealURL ?

• 'Lesbare' URLs

• für Menschen

• für Suchmaschinen

Montag, 28. Februar 2011

Page 7: Why RealURL sucks - and how to fix it

SimulateStatic

• Home -> Produkte -> TV -> LCD

[domain]/lcd.html

• Home -> Impressum

[domain]/impressum.html

Montag, 28. Februar 2011

Page 8: Why RealURL sucks - and how to fix it

Installation

• Konfigurationsdatei:

Montag, 28. Februar 2011

Page 9: Why RealURL sucks - and how to fix it

Installation

• Automatische Konfiguration:

typo3conf/realurl_autoconf.php

• Achtung:wird gelöscht bei Anlegen eines Domain-Records!

Montag, 28. Februar 2011

Page 10: Why RealURL sucks - and how to fix it

Installation

Montag, 28. Februar 2011

Page 11: Why RealURL sucks - and how to fix it

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

Page 12: Why RealURL sucks - and how to fix it

ohne Konfiguration

• [domain]/index.php?id=123

• [domain]/123/

• [domain]/alias/

Montag, 28. Februar 2011

Page 13: Why RealURL sucks - and how to fix it

Autokonfiguration

• [domain]/index.php?id=123

• [domain]/seitentitel/

• [domain]/navigationstitel/

• [domain]/alias/

Montag, 28. Februar 2011

Page 14: Why RealURL sucks - and how to fix it

Autokonfiguration

• Nur für Basis-Konfiguration ohne Extensions mit GET Variablen

Montag, 28. Februar 2011

Page 15: Why RealURL sucks - and how to fix it

Montag, 28. Februar 2011

Page 16: Why RealURL sucks - and how to fix it

/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

Page 17: Why RealURL sucks - and how to fix it

/abc/programme.html/abc/programme/windows.html/abc/programme/windows/windows-xp.html

Montag, 28. Februar 2011

Page 18: Why RealURL sucks - and how to fix it

/datei-downloads/software.html/datei-downloads/windows.html/datei-downloads/windows/windows-xp.html

Montag, 28. Februar 2011

Page 19: Why RealURL sucks - and how to fix it

Funktionsweise RealURL

• Seiten ID + Parameter -> URL

• URL -> Seiten ID + Parameter

Montag, 28. Februar 2011

Page 20: Why RealURL sucks - and how to fix it

Teile der URLDomain www.test.de

preVars en

pagePath shop/products/

fixedPostVars create

postVarSets article/123/color

fileName detail.html

Montag, 28. Februar 2011

Page 21: Why RealURL sucks - and how to fix it

Kodierung

Überschriften ueberschriften

Académie française academie-francaise

Español espanol

Фотосессия fotosessija

Ελλάδα ellada

מדינת ישראל mdint-ishral

Montag, 28. Februar 2011

Page 22: Why RealURL sucks - and how to fix it

Multi Domain[www.domain1.de] => array ( ... ),

[www.domain1.de] => array ( ... ),

[_DEFAULT] => array ( ... ),

Montag, 28. Februar 2011

Page 23: Why RealURL sucks - and how to fix it

Multi Domain[_DEFAULT] => array ( ... ),

[www.domain1.de] => array ( ... ),

[www.domain2.de] => array ( ... ),

Montag, 28. Februar 2011

Page 24: Why RealURL sucks - and how to fix it

Konfiguration[domain]

init => array (...),redirects => array (...),redirects_regex => array (...),preVars => array (...),pagePath => array (...),fixedPostVars => array (...),postVarSets => array (...)fileName => array (...)

Montag, 28. Februar 2011

Page 25: Why RealURL sucks - and how to fix it

init 'enableCHashCache' => true, 'appendMissingSlash' => 'ifNotFile,redirect', 'adminJumpToBackend' => true, 'enableUrlDecodeCache' => true, 'enableUrlEncodeCache' => true, 'emptyUrlReturnValue' => '/', 'respectSimulateStaticURLs' => true,

Montag, 28. Februar 2011

Page 26: Why RealURL sucks - and how to fix it

'doNotRawUrlEncodeParameterNames' => true,

• tx_ttnews%5Btt_news%5D=3

wird zu

• tx_ttnews[tt_news]=3

init

Montag, 28. Februar 2011

Page 27: Why RealURL sucks - and how to fix it

'enableAllUnicodeLetters' => true,

• ermöglicht URLs in der Form

http://name-der-domain.de/普通話/

init

Montag, 28. Februar 2011

Page 28: Why RealURL sucks - and how to fix it

'postVarSet_failureMode' => 'redirect_goodUpperDir',

init

Montag, 28. Februar 2011

Page 29: Why RealURL sucks - and how to fix it

'postVarSet_failureMode' => 'ignore',

init

Montag, 28. Februar 2011

Page 30: Why RealURL sucks - and how to fix it

Montag, 28. Februar 2011

Page 31: Why RealURL sucks - and how to fix it

redirects

'redirects' =>. array ( 'aktuelles/' => '301;http://spiegel.de', ),

Montag, 28. Februar 2011

Page 32: Why RealURL sucks - and how to fix it

redirects_regex

'redirects_regex' =>. array ( '^english/(.*)' => '301;en/\1',

'^downloads/(.*)' => 'ftp://dl.domain.tld/public/dl/\1', ),

Montag, 28. Februar 2011

Page 33: Why RealURL sucks - and how to fix it

Teile der URLDomain www.test.de

preVars en

pagePath shop/products/

fixedPostVars create

postVarSets article/123/color

fileName detail.html

Montag, 28. Februar 2011

Page 34: Why RealURL sucks - and how to fix it

preVars

• http://[domain]/en/news/articel.html

Montag, 28. Februar 2011

Page 35: Why RealURL sucks - and how to fix it

preVars'preVars' => array ( 0 => array ( 'GETvar' => 'L', 'valueMap' =>. array ( 'en' => '1', ), 'noMatch' => 'bypass', ), ),

Montag, 28. Februar 2011

Page 36: Why RealURL sucks - and how to fix it

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

Page 37: Why RealURL sucks - and how to fix it

'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

Page 38: Why RealURL sucks - and how to fix it

Teile der URLDomain www.test.de

preVars en

pagePath shop/products/

fixedPostVars create

postVarSets article/123/color

fileName detail.html

Montag, 28. Februar 2011

Page 39: Why RealURL sucks - and how to fix it

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

Page 40: Why RealURL sucks - and how to fix it

Teile der URLDomain www.test.de

preVars en

pagePath shop/products/

fixedPostVars create

postVarSets article/123/color

fileName detail.html

Montag, 28. Februar 2011

Page 41: Why RealURL sucks - and how to fix it

postVarSetsfixedPostVars

postVarsSets => array ('123' => array (...),'_DEFAULT' => array (...),

),

Montag, 28. Februar 2011

Page 42: Why RealURL sucks - and how to fix it

postVarSets

postVarsSets => array ('_DEFAULT' => array (

'news' => array (...),'calendar' => array (...),'shop' => array (...),

),),

Montag, 28. Februar 2011

Page 43: Why RealURL sucks - and how to fix it

postVarSetspostVarsSets => array (

'_DEFAULT' => array ('news' => array ('list' => array (...),'single' => array (...),'archive' => array (...),

),),

),Montag, 28. Februar 2011

Page 44: Why RealURL sucks - and how to fix it

'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

Page 45: Why RealURL sucks - and how to fix it

Teile der URLDomain www.test.de

preVars en

pagePath shop/products/

fixedPostVars create

postVarSets article/123/color

fileName detail.html

Montag, 28. Februar 2011

Page 46: Why RealURL sucks - and how to fix it

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