Updated routing recipe

This commit is contained in:
Jan Böhmer 2025-11-30 15:01:37 +01:00
parent 3dc66542b2
commit bb650c2218
4 changed files with 31 additions and 22 deletions

View file

@ -1,3 +1,12 @@
# yaml-language-server: $schema=../vendor/symfony/routing/Loader/schema/routing.schema.json
# This file is the entry point to configure the routes of your app.
# Methods with the #[Route] attribute are automatically imported.
# See also https://symfony.com/doc/current/routing.html
# To list all registered routes, run the following command:
# bin/console debug:router
# Redirect every url without an locale to the locale of the user/the global base locale
scan_qr:
@ -16,4 +25,4 @@ redirector:
url: ".*"
controller: App\Controller\RedirectController::addLocalePart
# Dont match localized routes (no redirection loop, if no root with that name exists) or API prefixed routes
condition: "not (request.getPathInfo() matches '/^\\\\/([a-z]{2}(_[A-Z]{2})?|api)\\\\//')"
condition: "not (request.getPathInfo() matches '/^\\\\/([a-z]{2}(_[A-Z]{2})?|api)\\\\//')"