Skip to content

Instantly share code, notes, and snippets.

@serapheem
Created November 27, 2012 12:28
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save serapheem/4153979 to your computer and use it in GitHub Desktop.
Save serapheem/4153979 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