Skip to content

Instantly share code, notes, and snippets.

@bocharsky-bw
Last active August 29, 2015 14:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bocharsky-bw/375c0c816598a029f2f1 to your computer and use it in GitHub Desktop.
Save bocharsky-bw/375c0c816598a029f2f1 to your computer and use it in GitHub Desktop.
The multilingual router example with excluding default locale from URI for Symfony Framework
home_redirect:
host: "%domain%"
pattern: /%locale%/
defaults:
_controller: FrameworkBundle:Redirect:urlRedirect
path: /
permanent: false
home_locale:
host: "%domain%"
pattern: /{_locale}/
defaults: { _controller: BWMainBundle:Main:index }
home:
host: "%domain%"
pattern: /
defaults: { _controller: BWMainBundle:Main:index, _locale: "%locale%" }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment