Task #104202
openSiteBaseRedirectResolver Middleware should use 301 for redirects or respect configuration.
0%
Description
Middleware implementation `TYPO3\CMS\Frontend\Middleware\SiteBaseRedirectResolver` redirects to the language base path. It does so with a http status 307 which is static in the code. As the base url for each language is pretty fixed for a site, this should be a 301 redirect. Alternatively, the middleware should respect the settings from
`settings.redirects.httpStatusCode`
Updated by Georg Ringer 5 days ago
- Status changed from New to Needs Feedback
Hey Martin,
thanks for creating the issue. The reason for a 301 is that 301 means that this redirect is allowed to be cached by proxies & clients forever.
For a CMS where things can change during lifetime this is a bad thing - this is also the reason why by default a 307 is set everywhere. I understand that especially SEO people really want to see a 301 because it is somehow a bit better.
The mentioned setting is for dynamic generated redirects during changing the slugs only and can't be used.
I suggest to keep the 307 in the core and don't introduce another setting just for that. If you want to change the 307 to a 301 I suggest creating a custom middleware which replaces the existing one, or patch it with composer-patches or by XCLASS or by using a redirect within a .htaccess
file.
Would that be ok for you?