[英]TYPO3 RealUrl switch to manual config produces error
I'm doing the exact steps of the following answer: https://stackoverflow.com/a/16731438 我正在执行以下答案的确切步骤: https : //stackoverflow.com/a/16731438
However, if I switch to Manual Configuration I got the following error, even if my realurl_conf.php is the exact same file as realurl_autoconf.php was before: 但是,如果我切换到“手动配置”,则即使我的realurl_conf.php与realurl_autoconf.php之前的文件完全相同,也会出现以下错误:
Page Not Found
Reason: Segment "fotografie" was not a keyword for a postVarSet as expected on page with id=0.
If I switch back to automatic config everything works as expected. 如果我切换回自动配置,则一切正常。
Any ideas on that? 有什么想法吗?
TYPO3 7.6.11 TYPO3 7.6.11
Here is the realurl_autoconf.php
: 这是realurl_autoconf.php
:
<?php
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl']=array (
'brightfocus.de' =>
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,
),
),
),
),
'postVarSets' =>
array (
'_DEFAULT' =>
array (
't3extblog-action' =>
array (
0 =>
array (
'GETvar' => 'tx_t3extblog_blogsystem[action]',
'noMatch' => 'bypass',
),
),
'article' =>
array (
0 =>
array (
'GETvar' => 'tx_t3extblog_blogsystem[year]',
),
1 =>
array (
'GETvar' => 'tx_t3extblog_blogsystem[month]',
),
2 =>
array (
'GETvar' => 'tx_t3extblog_blogsystem[day]',
),
3 =>
array (
'GETvar' => 'tx_t3extblog_blogsystem[post]',
'lookUpTable' =>
array (
'table' => 'tx_t3blog_post',
'id_field' => 'uid',
'alias_field' => 'title',
'addWhereClause' => ' AND NOT deleted AND NOT hidden',
'useUniqueCache' => 1,
'useUniqueCache_conf' =>
array (
'strtolower' => 1,
'spaceCharacter' => '-',
),
'enable404forInvalidAlias' => 1,
'autoUpdate' => 1,
'expireDays' => 180,
'languageGetVar' => 'L',
'languageExceptionUids' => '',
'languageField' => 'sys_language_uid',
'transOrigPointerField' => 'l18n_parent',
),
),
),
'comment' =>
array (
0 =>
array (
'GETvar' => 'tx_t3extblog_blogsystem[controller]',
'noMatch' => 'bypass',
'valueMap' =>
array (
'new' => 'Comment',
),
),
),
'permalink' =>
array (
0 =>
array (
'GETvar' => 'tx_t3extblog_blogsystem[permalinkPost]',
),
),
'preview' =>
array (
0 =>
array (
'GETvar' => 'tx_t3extblog_blogsystem[previewPost]',
),
),
'author' =>
array (
0 =>
array (
'GETvar' => 'tx_t3extblog_blogsystem[author]',
'lookUpTable' =>
array (
'table' => 'be_users',
'id_field' => 'uid',
'alias_field' => 'username',
'addWhereClause' => ' AND deleted !=1 AND disable !=1',
'useUniqueCache' => 1,
'useUniqueCache_conf' =>
array (
'strtolower' => 1,
'spaceCharacter' => '-',
),
'enable404forInvalidAlias' => 1,
'autoUpdate' => 1,
'expireDays' => 180,
),
),
),
'tags' =>
array (
0 =>
array (
'GETvar' => 'tx_t3extblog_blogsystem[tag]',
),
),
'category' =>
array (
0 =>
array (
'GETvar' => 'tx_t3extblog_blogsystem[category]',
'lookUpTable' =>
array (
'table' => 'tx_t3blog_cat',
'id_field' => 'uid',
'alias_field' => 'catname',
'addWhereClause' => ' AND deleted !=1 AND hidden !=1',
'useUniqueCache' => 1,
'useUniqueCache_conf' =>
array (
'strtolower' => 1,
'spaceCharacter' => '-',
),
'enable404forInvalidAlias' => 1,
'autoUpdate' => 1,
'expireDays' => 180,
'languageGetVar' => 'L',
'languageExceptionUids' => '',
'languageField' => 'sys_language_uid',
'transOrigPointerField' => 'l18n_parent',
),
),
),
'page' =>
array (
0 =>
array (
'GETvar' => 'tx_t3extblog_blogsystem[@widget_0][currentPage]',
),
),
'subscription' =>
array (
0 =>
array (
'GETvar' => 'tx_t3extblog_subscriptionmanager[controller]',
'valueMap' =>
array (
'blog' => 'BlogSubscriber',
'post' => 'PostSubscriber',
),
'noMatch' => 'bypass',
),
1 =>
array (
'GETvar' => 'tx_t3extblog_subscriptionmanager[action]',
'valueMap' =>
array (
'confirmation' => 'confirm',
'create' => 'create',
'delete' => 'delete',
'error' => 'error',
'logout' => 'logout',
),
'noMatch' => 'bypass',
),
2 =>
array (
'GETvar' => 'tx_t3extblog_subscriptionmanager[code]',
),
),
'subscription-blog' =>
array (
0 =>
array (
'GETvar' => 'tx_t3extblog_blogsubscription[action]',
),
),
),
),
),
);
Edit: Maybe there is something wrong with the rootpageId: If i edit the autoconf from rootpage id 1
to rootpage id 2
i get the following error: Page Not Found 编辑:也许rootpageId出了点问题:如果我将自动配置从rootpage id 1
为rootpage id 2
,则会出现以下错误:找不到页面
Reason: Segment "fotografie" was not a keyword for a postVarSet as expected on page with id=2.
=> I assume the part id=2
comes from my rootpageId. =>我假设部件id=2
来自我的rootpageId。 Going back to my original error, i assume there is somehow a rootpageId of 0
specified (even if set rootpage_id = '1'
回到我的原始错误,我假设以某种方式指定了rootpageId为0
(即使设置了rootpage_id = '1'
I have the following site structure: 我具有以下站点结构:
id=0
|id=1 (Home; Redirect to id=2; marked as rootpage)
-|id=2 (Startseite)
-|id=3 (Fotografie)
-|id=4 (Grafikdesign)
I know this is not ideal, but with autoconf this structure is working, so i assume there must be a way to get this working with manual conf, without changig the structure (because i don't think this would be trivial) 我知道这不是理想的,但是使用autoconf可以正常工作,所以我认为必须有一种方法可以在不更改结构的情况下使用手动conf(因为我不认为这很简单)
Try this very minimal config: The rootpage is defined also the domainname, this may work, but I always have trouble with realurl on diffeerent types of domain (local/sub/nregular) and caching of paths. 试试这个非常小的配置:根页面也被定义为域名,这也许可行,但是我总是在不同类型的域(本地/子/非常规)和路径缓存上使用realurl遇到麻烦。
Paths cache can be flushed in the backend: Web > Speaking URL's > "select a page in tree" > Flush all Entries (harmful). 可以在后端刷新路径缓存:Web>口述URL>“选择树中的页面”>刷新所有条目(有害)。 Dont do this on an indexed site! 不要在索引网站上执行此操作!
Hope this config works for you. 希望此配置对您有用。
<?php
$GLOBALS['TYPO3_CONF_VARS']['EXTCONF']['realurl'] = array (
'_DEFAULT' => array (
'init' => array (
'enableCHashCache' => '1',
'appendMissingSlash' => 'ifNotFile',
'enableUrlDecodeCache' => '1',
'enableUrlEncodeCache' => '1',
),
'redirects' => array (
),
'pagePath' => array (
'type' => 'user',
'userFunc' => 'EXT:realurl/class.tx_realurl_advanced.php:&tx_realurl_advanced->main',
'spaceCharacter' => '-',
'languageGetVar' => 'L',
'expireDays' => '7',
'rootpage_id' => $rootpageId,
),
),
);
switch($_SERVER['HTTP_HOST']) {
case 'yourwebsite.com':
case 'www.yourwebsite.com':
$TYPO3_CONF_VARS['FE']['pageNotFound_handling'] = 'index.php?id=4';
$TYPO3_CONF_VARS['FE']['pageNotFound_handling_statheader'] = 'HTTP/1.0 404 Not Found';
$rootpageId = 1;
break;
}
?>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.