Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typo3/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
TYPO3 RealURL语言域配置_Typo3_Typo3 7.6.x_Realurl - Fatal编程技术网

TYPO3 RealURL语言域配置

TYPO3 RealURL语言域配置,typo3,typo3-7.6.x,realurl,Typo3,Typo3 7.6.x,Realurl,我们有以下场景: 该网站有3个域名 域.de domain.eu domain.com.tr TYPO3已为多语言设置,语言的ID为: 默认值(de)=0 en=1 tr=2 有人能为我们提供正确的RealURL配置吗?试试这个,你只需要覆盖其他子域的默认配置 $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl'] = array ( 'encodeSpURL_postProc' => array('user_encodeSpUR

我们有以下场景:

该网站有3个域名

  • 域.de
  • domain.eu
  • domain.com.tr
TYPO3已为多语言设置,语言的ID为:

  • 默认值(de)=0
  • en=1
  • tr=2

有人能为我们提供正确的RealURL配置吗?

试试这个,你只需要覆盖其他子域的默认配置

$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl'] = array (
    'encodeSpURL_postProc' => array('user_encodeSpURL_postProc'),
    'decodeSpURL_preProc' => array('user_decodeSpURL_preProc'),
    '_DEFAULT' => array (
        'init' => array (
            'enableCHashCache' => '1',
            'appendMissingSlash' => 'ifNotFile',
            'enableUrlDecodeCache' => '1',
            'enableUrlEncodeCache' => '1'
        ),
        'redirects' => array (
        ),
        'preVars' => array (
            '0' => array (
                'GETvar' => 'no_cache',
                'valueMap' => array (
                    'nc' => '0'
                ),
                'noMatch' => 'bypass',
            ),
            '1' => array (
                'GETvar' => 'L',
                'valueMap' => array (
                    'de' => '0',
                    'en' => '1',
                    'tr' => '2'
                ),
                'noMatch' => 'bypass'
            ),
        ),
        'pagePath' => array (
            'type' => 'user',
            'userFunc' => 'EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main',
            'spaceCharacter' => '-',
            'languageGetVar' => 'L',
            'rootpage_id' => '1'
        ),
        'fixedPostVars' => array (
        ),
        'postVarSets' => array (
            '_DEFAULT' => array (
                'archive' => array (
                    '0' => array (
                        'GETvar' => 'tx_ttnews[year]'
                    ),
                    '1' => array (
                        'GETvar' => 'tx_ttnews[month]',
                        'valueMap' => array (
                            'january' => '01',
                            'february' => '02',
                            'march' => '03',
                            'april' => '04',
                            'may' => '05',
                            'june' => '06',
                            'july' => '07',
                            'august' => '08',
                            'september' => '09',
                            'october' => '10',
                            'november' => '11',
                            'december' => '12'
                        ),
                    ),
                ),
                'page' => array (
                    '0' => array (
                        'GETvar' => 'tx_ttnews[pointer]'
                    ),
                ),
                'category' => array (
                    '0' => array (
                        'GETvar' => 'tx_ttnews[cat]',
                        'lookUpTable' => array (
                            'table' => 'tt_news_cat',
                            'id_field' => 'uid',
                            'alias_field' => 'title',
                            'addWhereClause' => ' AND NOT deleted',
                            'useUniqueCache' => '1',
                            'useUniqueCache_conf' => array (
                                'strtolower' => '1',
                                'spaceCharacter' => '-'
                            ),
                        ),
                    ),
                ),
                'article' => array (
                    '0' => array (
                        'GETvar' => 'tx_ttnews[tt_news]',
                        'lookUpTable' => array (
                            'table' => 'tt_news',
                            'id_field' => 'uid',
                            'alias_field' => 'title',
                            'addWhereClause' => ' AND NOT deleted',
                            'useUniqueCache' => '1',
                            'useUniqueCache_conf' => array (
                                'strtolower' => '1',
                                'spaceCharacter' => '-'
                            ),
                        ),
                    ),
                    '1' => array (
                        'GETvar' => 'tx_ttnews[swords]'
                    ),
                ),                
            ),
        ),
        'fileName' => array (
            #'defaultToHTMLsuffixOnPrev' => '.html',
            #'acceptHTMLsuffix' => 1,
            'index' => array (
                'rss.xml' => array (
                    'keyValues' => array (
                        'type' => '100'
                    ),
                ),
                'rss091.xml' => array (
                    'keyValues' => array (
                        'type' => '101'
                    ),
                ),
                'rdf.xml' => array (
                    'keyValues' => array (
                        'type' => '102'
                    ),
                ),
                'atom.xml' => array (
                    'keyValues' => array (
                        'type' => '103'
                    ),
                ),
                'sitemap.xml' => array (
                    'keyValues' => array (
                        'type' => '776'
                    ),
                ),              
            ),
        ),
    )
);
/*
 * All your other domain configuration goes here. Change your domain name      
 * and domain root page id as per your need.
 * 
 */
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['domain.de'] = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['_DEFAULT'];
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['domain.de']['pagePath']['rootpage_id'] = '41'; // Change your sub-domain root page id

$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['domain.eu'] = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['_DEFAULT'];
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['domain.eu']['pagePath']['rootpage_id'] = '51'; // Change your sub-domain root page id

$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['domain.com.tr'] = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['_DEFAULT'];
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['domain.com.tr']['pagePath']['rootpage_id'] = '61'; // Change your sub-domain root page id
请根据您的需要更改代码。希望这对你有帮助


你好

Follow解决方案通过域进行语言检测:

<?php
  $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl'] = [
    'www.domain.de' => [ /* main configuration */,
    'www.domain.eu' => 'www.domain.de',
    'www.domain.tr' => 'www.domain.de',
    '_DOMAINS' => [
      'encode' => [
        [
          'GETvar' => 'L',
          'value' => '0',
          'useConfiguration' => 'www.domain.de',
          'urlPrepend' => 'https://www.domain.de'
        ],
        [
          'GETvar' => 'L',
          'value' => '1',
          'useConfiguration' => 'www.domain.eu',
          'urlPrepend' => 'https://www.domain.eu'
        ],
        [
          'GETvar' => 'L',
          'value' => '2',
          'useConfiguration' => 'www.domain.tr',
          'urlPrepend' => 'https://www.domain.tr'
        ]
      ],
      'decode' => [
        'www.domain.de' => [
          'GETvars' => [
            'L' => '',
          ],
          'useConfiguration' => 'www.domain.de',
        ],
        'www.domain.eu'  => [
          'GETvars' => [
            'L' => '1',
          ],
          'useConfiguration' => 'www.domain.eu',
        ],
        'www.domain.tr' => [
          'GETvars' => [
            'L' => '2',
          ],
          'useConfiguration' => 'www.domain.tr',
        ]
      ]
    ];

对多个域使用下面的realurl配置

<?php
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']=array (
  '_DEFAULT' =>
  array (
    'init' =>
    array (
      'appendMissingSlash' => 'ifNotFile,redirect',
    ),
    'pagePath' =>
    array (
      'rootpage_id' => '1',
    ),
    'fixedPostVars' => array(
    ),
    'fileName' =>
    array (
      'defaultToHTMLsuffixOnPrev' => 0,
      'acceptHTMLsuffix' => 1,
      'index' =>
      array (
        'print' =>
        array (
          'keyValues' =>
          array (
            'type' => 98,
          ),
        ),
      ),
    ),
    'preVars' =>
    array (
      0 =>
      array (
        'GETvar' => 'L',
        'valueMap' =>
        array (
          'en' => '1',
          'tr' => '2'
        ),
        'noMatch' => 'bypass',
      ),
    ),

    'postVarSets' =>array (
      '_DEFAULT' =>array (

      ),
    ),
  ),
);


$TYPO3_CONF_VARS['EXTCONF'] ['realurl'] ['domain.de'] = $TYPO3_CONF_VARS['EXTCONF']['realurl']['_DEFAULT'];
$TYPO3_CONF_VARS['EXTCONF'] ['realurl'] ['domain.de'] ['pagePath'] ['rootpage_id'] = '1'; //Root Page Id

$TYPO3_CONF_VARS['EXTCONF'] ['realurl'] ['domain.eu'] = $TYPO3_CONF_VARS['EXTCONF']['realurl']['_DEFAULT'];
$TYPO3_CONF_VARS['EXTCONF'] ['realurl'] ['domain.eu'] ['pagePath'] ['rootpage_id'] = '169'; //Root Page Id

$TYPO3_CONF_VARS['EXTCONF'] ['realurl'] ['domain.com.tr'] = $TYPO3_CONF_VARS['EXTCONF']['realurl']['_DEFAULT'];
$TYPO3_CONF_VARS['EXTCONF'] ['realurl'] ['domain.com.tr'] ['pagePath'] ['rootpage_id'] = '386'; //Root Page Id

您能否至少提供一些自己解决问题的方法?stackoverflow的目的并不完全是要求其他人进行配置。