Project

General

Profile

Actions

Bug #103395

closed

Redirects with domains without site configuration not possible anymore

Added by Georg Ringer about 2 months ago. Updated about 1 month ago.

Status:
Resolved
Priority:
Should have
Assignee:
Category:
Redirect Handling
Target version:
-
Start date:
2024-03-14
Due date:
% Done:

100%

Estimated time:
TYPO3 Version:
12
PHP Version:
Tags:
Complexity:
Is Regression:
Sprint Focus:

Description

I upgraded a larger site from 10 to 12 LTS and some redirects don't work anymore.

Setup:

  • Main Domain: customer.tld
  • Domain other-domain.tld points to the same directory as main domain
  • Redirect other-domain.tld/foo to a valid page customer/tld.

The error No TypoScript record found is thrown triggered from

\TYPO3\CMS\Frontend\Controller\TypoScriptFrontendController::getFromCache
\TYPO3\CMS\Redirects\Service\RedirectService::bootFrontendController

which is valid as there is no site for other-domain and I also don't want to provide one

my working solution/patch is

--- a/Classes/Service/RedirectService.php
+++ b/Classes/Service/RedirectService.php
@@ -395,6 +395,9 @@
             new PageArguments($site->getRootPageId(), '0', []),
             $originalRequest->getAttribute('frontend.user')
         );
+        if ($originalRequest->getAttribute('site') instanceof NullSite) {
+            $originalRequest = $originalRequest->withAttribute('site', GeneralUtility::makeInstance(SiteFinder::class)->getSiteByRootPageId(1));
+        }
         $controller->determineId($originalRequest);
         $controller->calculateLinkVars($queryParams);
         $newRequest = $controller->getFromCache($originalRequest);


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Task #103555: Add `RedirectService` tests as preparation for a bugfixResolvedStefan Bürk2024-04-07

Actions
Actions

Also available in: Atom PDF