3

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


            ),
Urs
  • 4,984
  • 7
  • 54
  • 116

2 Answers2

5

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
Sven
  • 722
  • 1
  • 7
  • 25
  • I just saw this now. It sounds extremely convincing, but I cant' get it to work (with 7.6 and realURL 2.x). Do you use that successfully? – Urs Apr 07 '16 at 18:19
  • 1
    Got it, awesome! I had `config.linkVars = L(0,1)` in the config, which would prevent it from working. Setting `config.linkVars=L` helped. – Urs Apr 07 '16 at 18:27
  • 1
    Yea. 'config.defaultGetVars.L' works for sure. But I'm looking for a solution within the realurl_conf and by not touching typoScript. Any ideas ?? – Anu Bhuvanendran Nair Jul 26 '16 at 12:08
4

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.

Shufla
  • 872
  • 4
  • 10
  • 2
    This doesn't seem to work with 7.6 anymore. Setting `config.defaultGetVars.L` makes sense and works! – Urs Apr 07 '16 at 18:30