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:
http://typo3.demo.local:3000/de/example1/
http://typo3.demo.local:3000/en/example1/
and so onhttp://typo3.demo.local:3000/
redirects to default language http://typo3.demo.local:3000/de/
by default behaviourhttp://typo3.demo.local:3000/test1/
to http://typo3.demo.local:3000/de/example1/
but there is no redirect, it shows the content from 404 page on http://typo3.demo.local:3000/test1/
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