Originally, some work was started in 2430335#89). And this issue was created.to resolve a caching issue. A language redirect was introduced, but the implementation was more general than just adding the language prefix. The target redirect URL was constructed from current route. This caused some test fails (especially, in case if this redirect is enabled always even if the language module is not installed, see
There is a new route_normalizer_request_subscriber service that perform redirects like the Global Redirect module. On a GET request, it construct a URL from the current route and the current route/query parameters, and redirects to that URL if it does not match the incoming URL. This causes:
- language redirect, for example from "/" to "/en", this resolves
- path alias redirect, for example from "node/1" to "content/my-node"
- front page redirect, for example from "/node" to "/"
There can be more cases, but they are unknown at the moment.
Also, the patch contains some fixes for bugs caught during development, and some documentation changes.
Arguments for this feature:
- globalredirect has a lot of installations, people might need this feature in the core
- better SEO
- less cache entries
- it allows to catch bugs at early development stage (check the fixes provided in the patch)
- fix remaining test fails
+ write tests
- try to use CacheableRedirectResponse
User interface changes
The default Drupal installation will behave like the one having the Global Redirect module enabled.
The "disable_route_normalizer" request attribute can be set to disable the route normalization:
Data model changes