RealUrl

A lot of the examples and instructions in the internet are misleading or even false. Therefore stick to the relevant weblinks at the end of this article: a simple instruction for single and multidomain setup and the documentation of realurl extension by Dmitry Dulepov.There might be even usful hints in the documentation.


For basic setup of RealUrl in the realurl_conf.php you can use the code below. All you need to do is to configure the first associative array. That is replace the domains with your domains and the page uids with your uids.

<?php
$rootpage_id = array (
        'domain1.tld' => 1,
        'www.domain1.tld' => 1,
        'domain2.tld' => 23,
        'www.domain2.tld' => 23,
        'domain3.tld' => 42,
        'www.domain3.tld' => 42,
);
$host = $_SERVER['HTTP_HOST'];
$tx_realurl_config = array(
        'init' => array(
                'enableCHashCache' => true,
                'appendMissingSlash' => 'ifNotFile',
                'enableUrlDecodeCache' => true,
                'enableUrlDecodeCache' => true,
                'emptyUrlReturnValue' => true,
        ),
        'preVars' => array(
                array(
                        'GETvar' => 'no_cache',
                                'valueMap' => array(
                                        'nc' => 1,
                                ),
                                'noMatch' => 'bypass',
                ),
                array(
                        'GETvar' => 'L',
                        'valueMap' => array(
                                'de' => '0',
                                'en' => '1',
                        ),
                        'valueDefault' => 'de',
                        'noMatch' => 'bypass',
                ),
        ),
        'fixedPostVars' => array(),
        'postVarSets' => array(
                '_DEFAULT' => array(
                        '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',
                                        )
                                ),
                        ),
                        'browse' => array(
                                array(
                                        'GETvar' => 'tx_ttnews[pointer]',
                                ),
                        ),
                        'select_category' => array (
                                array(
                                        'GETvar' => 'tx_ttnews[cat]',
                                ),
                        ),
                        '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[swords]',
                                ),
                        ),
                ),
        ),
        'pagePath' => array(
                'type' => 'user',
                'userFunc' => 'EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main',
                'spaceCharacter' => '-',
                'languageGetVar' => 'L',
                'expireDays' => 3,
                'rootpage_id' => $rootpage_id[$host],
        ),
        'fileName' => array (
                'defaultToHTMLsuffixOnPrev' => true,
                'index' => array(
                                'page.html' => array(
                                                'keyValues' => array (
                                                                'type' => 1,
                                                ),
                                ),
                ),
                '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,
                        ),
                ),
        ),
);
$TYPO3_CONF_VARS['EXTCONF']['realurl'] = array(
        $host => $tx_realurl_config,
);
unset($tx_realurl_config);
?>