Skip to content

Instantly share code, notes, and snippets.

@oliverthiele
Last active April 17, 2017 11:21
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save oliverthiele/d25436c41dc3b5041eb4 to your computer and use it in GitHub Desktop.
Save oliverthiele/d25436c41dc3b5041eb4 to your computer and use it in GitHub Desktop.
TYPO3 RealURL-Konfiguration Example
<?php
// Not needed in current RealURL versions: $TYPO3_CONF_VARS['FE']['addRootLineFields'] .= ',tx_realurl_pathsegment';
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl'] = array(
'_DEFAULT' => array(
'init' => array(
'enableCHashCache' => true,
'appendMissingSlash' => 'ifNotFile,redirect[301]',
'enableUrlDecodeCache' => true,
'enableUrlEncodeCache' => true,
'adminJumpToBackend' => true,
'respectSimulateStaticURLs' => 0,
'postVarSet_failureMode' => '',
'emptyUrlReturnValue' => '/',
'enableAllUnicodeLetters' => 1,
'doNotRawUrlEncodeParameterNames' => 1
),
// Don't use Redirects here. Redirects in webserver or reverse proxys are faster
'redirects' => array(),
'preVars' => array(
array(
'GETvar' => 'no_cache',
'valueMap' => array(
'nc' => 1,
),
'noMatch' => 'bypass',
),
array(
'GETvar' => 'L',
'valueMap' => array(
// Don't configure L=0, Duplicate Content is the result!
// 'en' => '0',
'de' => '1',
'at' => '2'
),
'valueDefault' => 'de',
'noMatch' => 'bypass',
),
),
'pagePath' => array(
'type' => 'user',
'userFunc' => 'EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main',
'spaceCharacter' => '-',
'languageGetVar' => 'L',
'expireDays' => 3,
'rootpage_id' => 1, // Your root page uid
'firstHitPathCache' => 1,
),
'fixedPostVars' => array(
'newsDetailConfiguration' => array(
array(
'GETvar' => 'tx_news_pi1[action]',
'valueMap' => array(
'detail' => '',
),
'noMatch' => 'bypass'
),
array(
'GETvar' => 'tx_news_pi1[controller]',
'valueMap' => array(
'News' => '',
),
'noMatch' => 'bypass'
),
array(
'GETvar' => 'tx_news_pi1[news]',
'lookUpTable' => array(
'table' => 'tx_news_domain_model_news',
'id_field' => 'uid',
'alias_field' => 'title',
'addWhereClause' => ' AND NOT deleted',
'useUniqueCache' => 1,
'useUniqueCache_conf' => array(
'strtolower' => 1,
'spaceCharacter' => '-'
),
'languageGetVar' => 'L',
'languageExceptionUids' => '',
'languageField' => 'sys_language_uid',
'transOrigPointerField' => 'l10n_parent',
'autoUpdate' => 1,
'expireDays' => 180,
)
)
),
'newsCategoryConfiguration' => array(
array(
'GETvar' => 'tx_news_pi1[overwriteDemand][categories]',
'lookUpTable' => array(
'table' => 'sys_category',
'id_field' => 'uid',
'alias_field' => 'title',
'addWhereClause' => ' AND NOT deleted',
'useUniqueCache' => 1,
'useUniqueCache_conf' => array(
'strtolower' => 1,
'spaceCharacter' => '-'
)
)
)
),
'newsTagConfiguration' => array(
array(
'GETvar' => 'tx_news_pi1[overwriteDemand][tags]',
'lookUpTable' => array(
'table' => 'tx_news_domain_model_tag',
'id_field' => 'uid',
'alias_field' => 'title',
'addWhereClause' => ' AND NOT deleted',
'useUniqueCache' => 1,
'useUniqueCache_conf' => array(
'strtolower' => 1,
'spaceCharacter' => '-'
)
)
)
),
# Edit pageUid => configuration
'8' => 'newsDetailConfiguration',
// '701' => 'newsDetailConfiguration', // For additional detail pages, add their uid as well
// '71' => 'newsTagConfiguration',
// '72' => 'newsCategoryConfiguration',
),
'postVarSets' => array(
'_DEFAULT' => array(
'plaintext' => array(
'type' => 'single', // Special feature of postVars
'keyValues' => array(
'type' => 99
)
),
'controller' => array(
array(
'GETvar' => 'tx_news_pi1[action]',
'noMatch' => 'bypass'
),
array(
'GETvar' => 'tx_news_pi1[controller]',
'noMatch' => 'bypass'
)
),
'dateFilter' => array(
array(
'GETvar' => 'tx_news_pi1[overwriteDemand][year]',
),
array(
'GETvar' => 'tx_news_pi1[overwriteDemand][month]',
),
),
'page' => array(
array(
'GETvar' => 'tx_news_pi1[@widget_0][currentPage]',
),
),
// Configuration for the old "ttnews" extension
// // 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',
// )
// ),
// ),
// // news pagebrowser
// 'browse' => array(
// array(
// 'GETvar' => 'tx_ttnews[pointer]',
// ),
// ),
// // news categories
// 'select_category' => array(
// array(
// 'GETvar' => 'tx_ttnews[cat]',
// ),
// ),
// // news articles and searchwords
// 'article' => array(
// 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' => '-',
// ),
// ),
// ),
// array(
// 'GETvar' => 'tx_ttnews[backPid]',
// ),
// array(
// 'GETvar' => 'tx_ttnews[swords]',
// ),
// ),
),
),
// configure filenames for different pagetypes
'fileName' => array(
// Slash or .html
'defaultToHTMLsuffixOnPrev' => 0,
'acceptHTMLsuffix' => 1,
'index' => array(
# If you want index.html simulated ...
// 'index.html' => array(
// 'keyValues' => array()
// ),
'_DEFAULT' => array(
'keyValues' => array()
),
'sitemap.xml' => array(
'keyValues' => array(
'type' => 20,
),
),
'print.html' => array(
'keyValues' => array(
'type' => 98,
),
),
'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,
),
),
),
),
),
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment