I use Symfony2's JMSI18nRoutingBundle to allow automatic internationalization of my routes. Individual route internationalization can be disabled in routing.yml as follows
index:
  pattern: /
  defaults: { _controller: AcmeBaseBundle:Welcome:indexRedirector }
  options:
    i18n: false
However, I normally annotate routes in the controllers and define just a prefix in routing.yml:
AcmeApiBundle:
  resource: "@AcmeApiBundle/Controller/"
  type:     annotation
  prefix:   /api
  options:
    i18n: false
In this case, disabling internationalization does not work properly and routes get matched only by adding the locale as a prefix for the URLs.
How to disable the internationalization for the all URLs in the bundle?
Specify the option in the annotations. Something like:
/**
 * @Route("/", options={"i18n" = false})
 */
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With