Project

General

Profile

Actions

Bug #93553

closed

Default language can not be determined for Site

Added by Stefan Froemken almost 3 years ago. Updated almost 3 years ago.

Status:
Closed
Priority:
Should have
Category:
Link Handling, Site Handling & Routing
Target version:
Start date:
2021-02-19
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
9
PHP Version:
7.2
Tags:
Complexity:
no-brainer
Is Regression:
Sprint Focus:

Description

Hello,

a customers website has 3 languages defined in SiteConfiguration:

Base: https://www.example.com/
- Language: 0 > Base: /de-de
Language: 1 > Base: /en-us
Language: 2 -> Base: /fr-fr

With help of some GeoIP tools and a .htaccess all calls will be redirected to their language related Base like /en-us.html

In earlier TYPO3 Versions (EXT:my_redirects) the customer has created an amount of short URLs like:

- /automobile
- /service
- ...

As my_redirects does not support TYPO3 9, the customer has moved all redirects to TYPO3s redirects module.

If you now call https://www.example.com/automobile it will result in a 404 Error page.

I have debugged into this problem and it seems that the issue is related to SiteMatcher::matchRequest(). The URL does not contain a $_GET['id'] so $pageId is 0. As $pageId is 0 $defaultLanguage will not be updated (line 126) and is still null. As $language is empty the next big condition will be called to build an URL to "/". As "/" does not match any configured bases $result['language'] is null. $defaultLanguage comes in and sets SiteLanguage to null.
Now we get a problem in SiteBaseRedirectResolver::process(). As SiteLanguage is null the ErrorController jumps in with pageNotFoundAction().

That way the configured redirect in RedirectHandler::process() will never be called.


Related issues 1 (0 open1 closed)

Related to TYPO3 Core - Task #92352: Remove feature switch for rearanged redirect middlewares and set new defaultClosedDaniel Goerz2020-09-21

Actions
Actions #1

Updated by Gerrit Code Review almost 3 years ago

  • Status changed from New to Under Review

Patch set 1 for branch master of project Packages/TYPO3.CMS has been pushed to the review server.
It is available at https://review.typo3.org/c/Packages/TYPO3.CMS/+/67969

Actions #2

Updated by Stefan Froemken almost 3 years ago

  • Related to Task #92352: Remove feature switch for rearanged redirect middlewares and set new default added
Actions #3

Updated by Stefan Froemken almost 3 years ago

  • Status changed from Under Review to Closed

I have moved the position of EXT:redirects Middleware to the new position like in TYPO3 10 which solves this issue.

Actions

Also available in: Atom PDF