Skip to content

Instantly share code, notes, and snippets.

@jbinfo
Forked from serapheem/gist:4153979
Created December 16, 2015 15:11
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 jbinfo/ce5600eb7ea276dc194c to your computer and use it in GitHub Desktop.
Save jbinfo/ce5600eb7ea276dc194c to your computer and use it in GitHub Desktop.
Symfony2 - Redirect one route to another from routing.yml
SomeRoute:
pattern: /someroute
defaults:
_controller: SomeBundle:Controller:action
AnotherRoute:
pattern: /anotherroute
defaults:
_controller: FrameworkBundle:Redirect:redirect
route: SomeRoute
permanent: true # this is for 301
page: 5 # you can pass additional attributes
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment