How can I have a second alias for a node to be displayed in a different view mode? I have nodes whose content type is X that I would like to render differently based on the node path.  I'd like to use the default view mode for a path alias and a custom view mode for the other path alias.  These aliases were created using the Pathauto module; both of them point to the same node.


/url/alias1/path => /node/123 (default view mode) 
/url/alias2/path => /node/123 (custom view mode)


I tried using mymodule.routing.yml to do this, but it does not appear to be picked up by the route system.

mymodule.program:
  path: '/url/alias2/path'
  defaults:
    _controller: '\Drupal\mymodule\Controller\RoutesController::setViewMode'
  requirements:
    _access: 'TRUE'


When I click on the alias with the custom view mode, I get the default view mode.  I put a logger statement in the routes controller setViewMode function and it is not reached. This suggests that the routing is not being 'tripped'. 

Am I missing something or trying to do something Drupal 8 cannot handle?

I looked at Routing and path aliases but that doesn't quite address my question.
There are many approaches in aliasing and routing, but I think splitting the task between both is the most effective:

Add an internal node route for the second view mode:

mymodule.custom_node:
  path: '/node_custom/{node}'
  defaults:
    _entity_view: 'node.custom_view_mode'
  requirements:
    _access: 'TRUE'


Then change the source path to /node_custom/123 before Pathauto saves the second alias in hook_pathauto_alias_alter().