Project

General

Profile

Actions

Bug #93553

closed

Default language can not be determined for Site

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

Status:
Closed
Priority:
Should have
Category:
Site Handling, Site Sets & 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

Also available in: Atom PDF