Catch-all routes based on template structure I have many of the templates organized into sub-folders. E.g. /manager/entries/edit.html, /manager/users/edit.html etc.

The site is using 4-segment URLs to access code in those templates, e.g. http://site.com/manager/entries/edit/{slug}, http://site.com/manager/users/edit/{id} etc.

Currently I have to set up custom route for every template, e.g.     'manager/users/edit/(.*)'        =&gt; 'manager/users/edit', etc.

Is there a way I could set up a "generic" route which would first check for existing templates in a subfolder (whether globally or on per-folder basis) and try to use that first? So I would not need to create route for each individual template.
What we often do for a section (lets call it Pages) is actually not use any custom routing, and control things in the templates.

Start by setting the section template to pages/index. In your index.html file, we usually have the following:

{# Look for a template for this entry type (if any), then look for a template matching #}
{# the entry's slug, and fallback to the default '_entry' template #}

{% include [
    'pages/' ~ entry.type,
    'pages/' ~ entry.slug,
    'pages/_entry'
] %}


Using Twig's array-style include means it'll look for templates, and if one doesn't exist, move onto the next. In this scenario, we can simply create a file for an entry type, or even for a specific slug, with a fallback to a default.

Your case might be different of course, but might be a step in the right direction.