简体   繁体   中英

realUrl not writing preVar for default language

I am running realURL 1.12.6 on TYPO3 4.5.26

I am used to realURL creating paths that contain the preVar also for the default language, like www.example.com/de/seite/ and www.example.com/en/page/

In one case, this is just not happening - or I think, only sometimes. In most of the cases, I get www.example.com/seite/ and www.example.com/en/page/

Where can this be changed?

PS: Here's the beginning of my realurlconf:

$TYPO3_CONF_VARS['EXTCONF']['realurl']['_DEFAULT'] = array(
    'init' => array(
        'enableCHashCache' => 1,
        'appendMissingSlash' => 'ifNotFile',
        'enableUrlDecodeCache' => 1,
        'enableUrlEncodeCache' => 1,
        'respectSimulateStaticURLs' => 0,
        //'postVarSet_failureMode'=>'redirect_goodUpperDir',
    ),
'redirects_regex' => array (

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


            ),

If I use this configuration (valueDefault is set, noMatch not) then 404 error page is not triggered when calling urls like www.domain.com/notexisting/someexistingpage/ or www.domain.com/notexisting/

The 404 page is only triggered when calling urls like www.domain.com/notexisting/alsonotexistingpage/

That means, realurl expects the first part of the url to be the language part (here: "notexisting") and if realurl can't map this key, it uses the "valueDefault". But I want the 404 to be triggered, how can I achieve this?

Edit: I've the solution now:

realurl config:

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

TypoScript config:

config.defaultGetVars.L  = 0
config.linkVars = L

Remove 'noMatch' => 'bypass', from your preVar configuration. The GET-Parameter "L" is not set to "0" if you open "www.example.com", so then the noMatch just bypasses the preVar configuration. If you only set valueDefault, it should work fine.

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