Do not redirect missing API prefixed routes to a localized version

This commit is contained in:
Jan Böhmer 2023-10-01 16:07:42 +02:00
parent c49aff5cfc
commit 469f9e8933

View file

@ -15,5 +15,5 @@ redirector:
requirements:
url: ".*"
controller: App\Controller\RedirectController::addLocalePart
# Dont match localized routes (no redirection loop, if no root with that name exists)
condition: "not (request.getPathInfo() matches '/^\\\\/[a-z]{2}(_[A-Z]{2})?\\\\//')"
# 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)\\\\//')"