Symfony 5.1
I'm updating some legacy code and I need the following routes to match:
/article/ <--- matches default page 1 and has trailing slash
/article/2 <--- matches pages 2 through n with no trailing slash
If I use the route annotation...
* @Route("/article/{page}", name="article_show", requirements={"page"="\d+"})
* @param int $page
* @return Response
*/
public function show(int $page = 1) {
it redirects /article/ to /article removing the trailing slash. /article/2 works.
How do I keep the trailing slash when the page is 1?