How to make multiple pattern in single Symfony routing?
Normally we have a routing as
blog:
pattern: /
defaults: { _controller: AcmeBlogB
The easiest way is to duplicate the block and make 2 routes.
blog:
pattern: /
defaults: { _controller: AcmeBlogBundle:Blog:index, page: 1 }
blog_index:
pattern: /index
defaults: { _controller: AcmeBlogBundle:Blog:index, page: 1 }
So you have the possibility to use both of them in your path if you need it.
Here you can see another post how to use regex in your routing. Perhaps you can write a simple regex, which checks whether index is set.
Edit:
If you work with annotations, which I prefer, then you can write more than one route over your Controller's Action method. Something like this:
/**
* @Route("/");
* @Route("/home");
*/