i have some simular Url Mapping in Yii2:
'urlManager' => [
'enablePrettyUrl' => true,
'showScriptName' => false,
'rules' => [
['pattern'=>'pages','route'=>'pages/index', 'suffix'=>'/'],
['pattern'=>'pages/<id:\d+>','route'=>'pages/single', 'suffix'=>'.html'],
]]
So, urls:
domain.com/pages/ - works fine
domain.com/pages - E404
domain.com/pages/321.html - works fine
domain.com/pages/321 - E404
If i remove suffix parameter from config array, then:
domain.com/pages/ - E404
domain.com/pages - works fine
domain.com/pages/321.html - E404
domain.com/pages/321 - works fine
Is it possible to make 'suffix' into link optional, e.g. 'pages' and 'pages/' will be followed to one direction? Thanks.