Problem with a forward slash in route

I have the following routes defined in the urlManager section of the config




'foo' => 'foo/index',

'foo/<action:\w+>' => 'foo/<action>',



If I call an url like http://example.com/foo then the first route is activated.

If I call an url like http://example.com/foo/bar then the second route is activated.

However if I call http://example.com/foo/ then I get page not found. (note the trailing slash).

How do I get this url to activate the first route?

The following doesn’t work.




'foo/' => 'foo/index', 



add ‘suffix’ => ‘/’, to your urlManager config eg





	'urlManager' => [

			'enablePrettyUrl'     => true,

			'showScriptName'      => false,

			'enableStrictParsing' => false,

			'suffix' => '/',



See URL suffixes section at http://www.yiiframework.com/doc-2.0/guide-runtime-routing.html