TYPO3 8.7 TypoScript 重定向在升级后不起作用 [英] TYPO3 8.7 TypoScript redirect not working after upgrade
问题描述
目前我正在将我们的网站从旧的 TYPO3 版本 (TYPO3 6.2.31) 迁移到最新的 (TYPO3 8.7.20).
Currently I am migrating our website from old TYPO3-version (TYPO3 6.2.31) to the latest (TYPO3 8.7.20).
在我们的导航栏中有一个帐户"按钮(对于登录用户),它引用了 id=12 的模板.
In our nav-bar there is a button 'Account' (for the logged-in users) which references to template with id=12.
问题:如果你没有登录,你应该被重定向到登录模板.
The problem: if you are not logged in, you should be redirected to the login template.
所以我们在 TypoScript 中添加了以下内容:
So we added the following in TypoScript:
[globalVar = TSFE:id=12] && [loginUser = ]
page.config >
page.config.additionalHeaders = Location: https://www.example.de/login/
[end]
在旧版本 (6.2.31) 中重定向有效,但现在在新版本 (8.7.20) 中不起作用.
In the old version (6.2.31) the redirect works, but now in the new version(8.7.20) it doesn't.
也许有语法变化...
提前致谢!
更新:条件 '[globalVar = TSFE:id=12] &&[loginUser = ]' 正常工作
Update: the condition '[globalVar = TSFE:id=12] && [loginUser = ]' is working as expected
推荐答案
config.additionalHeaders
已从字符串更改为数组.现在应该是:
config.additionalHeaders
was changed from a string to an array. It should now be:
config.additionalHeaders.10 {
header = Location: https://www.example.de/login/
}
参见 https://docs.typo3.org/Typo3cms/TyposcriptReference/Setup/Config/Index.html#additionalheaders 了解更多信息.
See https://docs.typo3.org/typo3cms/TyposcriptReference/Setup/Config/Index.html#additionalheaders for more information.
这篇关于TYPO3 8.7 TypoScript 重定向在升级后不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!