typo3typo3-9.x

TYPO3 redirects regarding base / leading to 404 when all languages are configured with language slug as base


How can I configure redirects within the TYPO3 v9 redirect module regarding the base / when all languages are configured with language slug as base /de/, /en/ and so on?

My Problem is a redirect with source_path like /something is resulting in a 404.

I checked with xdebug. The 404 happens because the processed $route does not have language information, which is set in config.yaml on key languages: but here not matching because of the defined base.

To make this more clear some examples:


Solution

  • This has been discussed for a while in https://forge.typo3.org/issues/87455#note-7

    So switch to TYPO3 10 which has a feature switch or use a workaround like this I copied from the forge issue:

    return [
        'frontend' => [
            'typo3/cms-redirects/redirecthandler' => [
                'disabled' => true,
            ],
            'hotfix-redirecthandler' => [
                'target' => \TYPO3\CMS\Redirects\Http\Middleware\RedirectHandler::class,
                'before' => [
                    'typo3/cms-frontend/base-redirect-resolver',
                ],
            ],
        ], 
    ];
    

    In an extension at Configuration/RequestMiddlewares.php