I have this in routes.php
:
$builder
->connect( '/a/*', [ "controller" => "Api", "action" => "foo" ] )
->setHost("domain.world");
This works perfectly for URLs like this https://domain.world/a/5nxdy9lmcthc
. I fail when I want to enable different routes depending on the first character(s) in the URL.
For example these different action targets:
a*
-->aAction
b*
-->bdAction
c*
-->cbAction
...
It works now with the /
but for some reasons I would like to omit the /
so the URL would be https://domain.world/a5nxdy9lmcthc
or https://domain.world/b5nxdy9lmcthc
and this would trigger different actions because of the a
and b
as first characters after the /
.
My question:
Is it possible or is the slash needed in order to use to *
?