0
votes

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

1

1 Answers

4
votes

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.