'Cancel locale an redirect to another one in Symfony

i have website in Symfony 4.2 with 3 prefixed locales:

annotations.yaml

controllers:
resource: ../../src/Controller/
type: annotation
prefix:
    en: '/en'
    de: '/de'
    cz: '/cz'

and with route annotations in controllers:

 /**
 * @Route({"en": "references"}, name="reference")
 * @Route({"cz": "reference"}, name="reference")
 * @Route({"de": "referenzen"}, name="reference")
 */

Now i need cancel deutch locale and all /de/route adresses redirect to /en/route. Is here any easy way to do it?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source