Bug #93553
closedDefault language can not be determined for Site
0%
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.