Search code examples
typo3realurl

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',
                    ),


            ),

Solution

  • 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