My routing is defined like this :
# New URLs
article_show:
pattern: /article/{id}
defaults: { _controller: AcmeDemoBundle:Article:show }
# Old URLs
article_show_legacy:
path: /article-{id}-{param}.html
requirements:
param: foo|bar
defaults:
_controller: FrameworkBundle:Redirect:redirect
route: article_show
permanent: true
I'd like to know how I can redirect article_show_legacy
to article_show
without param
parameter. At the moment whenever I access /article-1-foo.html
(for example), I'm redirected to /article/1?param=foo
. I would like to discard ?param=foo
so I'm redirected to /article/1
.
I know I can create one route for foo
and one route for bar
but in my case there's more cases.
Do I have to write my own redirect controller ?