Project

General

Profile

Actions

Task #104202

open

SiteBaseRedirectResolver Middleware should use 301 for redirects or respect configuration.

Added by Martin R. Krause 4 days ago. Updated 4 days ago.

Status:
Needs Feedback
Priority:
Should have
Assignee:
-
Category:
Link Handling, Site Handling & Routing
Target version:
Start date:
2024-06-25
Due date:
% Done:

0%

Estimated time:
TYPO3 Version:
12
PHP Version:
8.1
Tags:
Complexity:
no-brainer
Sprint Focus:

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`

Actions #1

Updated by Georg Ringer 4 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?

Actions

Also available in: Atom PDF