Just configure the processor for the longest URL (with all parts, including optional), for example:
$app->get('/controller/{method}/{param}',
function($method, $param) {
});
, URL-. , :
$app->get('/page/{pageName}', function($pageName) {
})->value('pageName', 'index');
, /page, $pageName 'index'.