我有一个使用8.7.22版本的TYPO3。这是一个多域名网站,这是域名的样子:
website.com/domain1
website.com/domain2
website.com/domain3
website.com/domain4
每个域在TYPO3中都有一棵单独的树,每个树都有不同的域记录。
现在,我正在尝试使Realurl适用于所有域,但是每次访问时都会出现此错误:
找不到页面原因:
段“ domain1”不是id = 1的页面上预期的postVarSet的关键字。
说实话,我绝对不知道如何在postVarSet部分中定义域。这是我当前的realurl配置:
<?php
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['_DEFAULT'] = array(
'init' => array(
'appendMissingSlash' => 'ifNotFile,redirect',
'emptyUrlReturnValue' => '/',
),
'pagePath' => array(
'rootpage_id' => '1',
),
'fileName' => array(
'defaultToHTMLsuffixOnPrev' => 0,
'acceptHTMLsuffix' => 1,
'index' => array(
'print' => array(
'keyValues' => array(
'type' => 98,
),
),
),
),
);
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['website.com/domain1'] = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['_DEFAULT'];
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['website.com/domain2'] = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['_DEFAULT'];
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['website.com/domain2']['pagePath']['rootpage_id'] = '274';
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['website.com/domain3'] = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['_DEFAULT'];
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['website.com/domain3']['pagePath']['rootpage_id'] = '256';
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['website.com/domain4'] = $GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['_DEFAULT'];
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']['website.com/domain4']['pagePath']['rootpage_id'] = '349';
有什么主意吗?
非常感谢
答案 0 :(得分:0)
这是我解决问题的方法:
Page:id=0
|
|--Main root page (domain record = website.com)
|---- Root 1 (domain record = website.com/domain1)
|---- Root 2 (domain record = website.com/domain2)
|---- Root 3 (domain record = website.com/domain4)
|---- Root 4 (domain record = website.com/domain3)
在包括主根页面在内的所有根页面中,我选中了“用作根页面”选项,并为新网站创建了模板。
最后,将此打字代码放到所有根目录中:
config.typolinkEnableLinksAcrossDomains = 1
config.absRefPrefix = /
config.tx_realurl_enable = 1