I have created a module and a routing yaml file:

    mymodule.dossier:
      path: '/dossiers/{node}/dossier'
      defaults:
        _entity_view: 'node.dossier_dossier'
      requirements:
        _permission: 'access content'

I have created a custom view mode `node.dossier_dossier` and the corresponding twig template.

Now if I go to `dossiers/1/dossier` it works and it displays the node with the `dossier_dossier` view mode and appropriate template.

This `node/1` has an automatic URL alias of `/dossiers/my-custom-path` (Pathauto).

If I try to access `/dossiers/my-custom-path/dossier`, it returns a *page not found*.

**How can I make this route work for my nodes for both** (default and path aliases) **URLs?**