[TYPO3-english] RealURL & TypoLink - Linking on wrong domain

Francis Bilodeau fbilodeau at dessinsdrummond.com
Sat Oct 18 20:45:58 CEST 2014


Hello!

I have a problem with RealURL which I wasn't able to fix. I hope you guys can help.

I basically have two different domains, one in french (www.frenchdomain.com) and one in english (www.englishdomain.com). I have two separate rootpage id , for example, the frenchdomain.com has a rootpage of 1 and the englishdomain.com has a rootpage of 15.

Now the problem is if on englishdomain.com I want to link on pageId 3 of the french domain, with various parameters, instead of linking there, it will create a link on englishdomain.com/index.php?id=3&param=1 instead of what I want which is: frenchdomain.com/detail/param. 

It doesn't seem to detect that the rootpage I am linking to is different from the current one. Linking inside the current domain tree works perfectly and the parameters are rewritten correctly, it's always when I am trying to link to another rootpage tree which is different than the current domain that it bugs.

Here's my tree in typo3.

-> FrenchDomain (ID:1)
   -> Page 1 
   -> Page 2
   -> Page 3
-> EnglishDomain (ID:15)
   -> Page 1
   -> Page 2
   -> Page 3

Here's the function I use to link, this function always return the current domain even if the pageId that I pass is not correct. Also, it doesn't rewrite my parameters.

$configuration = array(
   'parameter' => 3,
   'additionalParams' => '&category=1',
   'forceAbsoluteUrl' => 1,
   'returnLast' => 'url'
);
echo $this->cObj->typolink('abc', $configuration);


Here's my RealURL Config.

// RealURL configuration.
  $TYPO3_CONF_VARS['EXTCONF']['realurl'] = array(
      '_DEFAULT' => array(
        'preVars' => array(
        array(
           'GETvar' => 'L',
           'valueMap' => array(
              'english' => '1',
           ),
           'noMatch' => 'bypass',
         ),
         array(
           'GETvar' => 'no_cache',
           'noMatch' => 'bypass',
         ),
        ),
		
		// Init contains the global configuration, cache options...
		'init' => array(
			'appendMissingSlash' => 'ifNotFile'
		),

        'fileName' => array(
          // add .html suffix to the end of the path generated
          'defaultToHTMLsuffixOnPrev' => 1,
        ),

        'pagePath' => array(
           'type' => 'user',
           'userFunc' => 'EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main',
           'spaceCharacter' => '-',
           'languageGetVar' => 'L',
           'expireDays' => '3',
       	),

        'postVarSets' => array(
          '_DEFAULT' => array(
            'categorie' => array (
              array(
                'GETvar' => 'tx_ddimain_pi1[cmd]',
                'valueMap' => array(
                  'type' => 9,
				  'reload-comments' => 11,
				  'insert-comments' => 12,
				  'add-vote' => 13,
				  'confirm-comments' => 14,
				  'detail'	=> 16,
				  'theme' => 18,
				  'logout' => 25,
				  'delete' => 26,
				  'invite-facebook' => 27,
				  'mini' => 31,
				  'favoris' => 35,
                ),
                'noMatch' => 'bypass',
              ),
        ),

        'fixedPostVars' => array(
        ),
    ),
	),
);

// RealURL - MultiDomain
$TYPO3_CONF_VARS['EXTCONF']['realurl']['_DEFAULT']['enableDomainLookup'] = 1;

$TYPO3_CONF_VARS['EXTCONF']['realurl']['www.frenchdomain.com'] = $TYPO3_CONF_VARS['EXTCONF']['realurl']['_DEFAULT'];
$TYPO3_CONF_VARS['EXTCONF']['realurl']['www.frenchdomain.com']['pagePath']['rootpage_id'] = 1;

$TYPO3_CONF_VARS['EXTCONF']['realurl']['www.englishdomain.com'] = $TYPO3_CONF_VARS['EXTCONF']['realurl']['_DEFAULT'];
$TYPO3_CONF_VARS['EXTCONF']['realurl']['www.englishdomain.com']['pagePath']['rootpage_id'] = 15;


Thanks!



More information about the TYPO3-english mailing list