简体   繁体   中英

TYPO3 RealUrl: select pagetree and language from url segment

We have multiple pagetrees for each region (eg Germany, Suisse). The pages themselves are translated to several languages (eg de, en) using the L-Parameter.

Now Realurl should match from 2 url segments to the approriate page tree and language. I know how this can be done with separate domains for each region using the _Domains feature. But in this case the domain stays always the same for all regions. Can this be achieved with Realurl and how?

http://example.com/de/de => should map to pagetree with rootpage_id 1 and language de (L=0)

http://example.com/de/en => should map to pagetree with rootpage_id 1 and language en (L=1)

http://example.com/ch/de => should map to pagetree with rootpage_id 2 and language de (L=0)

http://example.com/ch/en => should map to pagetree with rootpage_id 2 and language en (L=1)

real_url.conf

<?php
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['_DEFAULT'] = array(
    'init' => array(
        'enableCHashCache' => 1,
        'appendMissingSlash' => 'ifNotFile,redirect',
        'adminJumpToBackend' => 1,
        'enableUrlDecodeCache' => 1,
        'enableUrlEncodeCache' => 1,
        'emptyUrlReturnValue' => '/'
    ),
    'pagePath' => array(
        'type' => 'user',
        'userFunc' => 'EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main',
        'spaceCharacter' => '-',
        'languageGetVar' => 'L',
        'expireDays' => '3',
        'rootpage_id' => 1,
        'firstHitPathCache'=>1
    ),
    'preVars' => array(
        array(
            'GETvar' => 'L',
            'valueMap' => array(
                'de' => '0',
                'en' => '1',
            ),
            'valueDefault' => 'de',
        ),
       array(
            'GETvar' => 'no_cache',
            'valueMap' => array(
                'no_cache' => 1,
            ),
            'noMatch' => 'bypass',
        ),
    ),
);

Now Realurl should match from 2 url segments to the approriate page tree and language.

RealURL cannot do that. Root page id is determined before segments are processed. It is defined by the domain record or your RealURL configuration.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM