Bug #82297
closedRedirect loop with workspace and realurl
100%
Description
We have a multidomain environment:
www.domain.com (main domain and login domain for backend)
www1.domain.com (another site tree with another live domain)
www1.domain is another site tree with its own domain, but we use a subdomain for it to improve cookie handling of backend sessions and backend previews. We also use TCEMAIN.previewdomain extensivly, but that's irreleveant). We also use realurl 2.X.
The current problem is:
An editor works in workspace only in tree of www1.domain.com and does not see the pagetree of www.domain.com. When he opens another tab (FE) with www.domain.com he gets an infinite redirect, which is done in https://github.com/TYPO3/TYPO3.CMS/blob/master/typo3/sysext/frontend/Classes/Controller/TypoScriptFrontendController.php#L2887
// Prevent redirection loop if (!empty($redirectUrl)) { // redirect and exit HttpUtility::redirect($redirectUrl, HttpUtility::HTTP_STATUS_307); }
The block should prevent redirect loops, but does not check if the actual $_SERVER['REQUEST_URI'] is the same as redirectUrl. When i extend the condition to
!empty($redirectUrl) && $redirectUrl !== $_SERVER['REQUEST_URI']
the redirect is not done and the page is shown as expected.
Another ticket, same place in code: https://forge.typo3.org/issues/65447