Default language can not be determined for Site
a customers website has 3 languages defined in SiteConfiguration:
- 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:
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.
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