Issue Task Rejected

#104202SiteBaseRedirectResolver Middleware should use 301 for redirects or respect configuration.

Martin R. Krause 06/25/24, 11:03 updated 07/04/24, 19:59

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`

Reviews 0

No change resolves or names this issue in its commit message, and no comment links one.

History 2

  1. Georg Ringer commented and changed status New Needs Feedback 06/25/24, 11:46

    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?

  2. Georg Ringer commented and changed status Needs Feedback Rejected 07/04/24, 19:59

    closing the issue as for lack of feedback and trying to have a clean(er) issue tracker.
    if you don’t agree, feel free to contact me via slack!