I've started using Symfony. I was trying to set up routing with slugs and had a problem.
When I enter no slug and no last slash site.me/lucky/number it's ok. But when I enter no slug with lash slash site.me/lucky/number/ I get 404 page. I found a workaround for it with additional "root" route, it can be seen in my routing file below.
Is it possible to use a single route entry? Is it possible to use multiple routes for the same action? Something like creating a link to a single route entry configured, so I don't have to make similar changes in many route entries.
I use php built-in server on ubuntu 16.
<!-- routing.xml -->
<?xml version="1.0" encoding="UTF-8" ?>
<routes xmlns="http://symfony.com/schema/routing"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://symfony.com/schema/routing
http://symfony.com/schema/routing/routing-1.0.xsd">
<route id="homepage" path="/">
<default key="_controller">AppBundle:Default:index</default>
</route>
<route id="lucky_number_root" path="lucky/number/">
<default key="_controller">AppBundle:Lucky:number</default>
<default key="max">100</default>
</route>
<route id="lucky_number" path="lucky/number/{max}">
<default key="_controller">AppBundle:Lucky:number</default>
<default key="max">100</default>
<requirement key="max">\d+</requirement>
</route>
</routes>