TYPO3 8.7 TypoScript redirect not working after upgrade
Asked Answered
I

1

0

Currently I am migrating our website from old TYPO3-version (TYPO3 6.2.31) to the latest (TYPO3 8.7.20).

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.

So we added the following in TypoScript:

[globalVar = TSFE:id=12] && [loginUser = ]
page.config >
page.config.additionalHeaders = Location: https://www.example.de/login/
[end]

In the old version (6.2.31) the redirect works, but now in the new version(8.7.20) it doesn't.

Maybe there is a syntax change...

Thanks in advance!

Update: the condition '[globalVar = TSFE:id=12] && [loginUser = ]' is working as expected

Ivon answered 12/12, 2018 at 9:47 Comment(0)
B
5

config.additionalHeaders was changed from a string to an array. It should now be:

config.additionalHeaders.10 {
  header = Location: https://www.example.de/login/
}

See https://docs.typo3.org/typo3cms/TyposcriptReference/Setup/Config/Index.html#additionalheaders for more information.

Bib answered 12/12, 2018 at 10:42 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.