Ignore parts of the url or dynamically rewrite/alias the url
Subpathauto might do what you need even if it wasn't written for that exact use case. https://www.drupal.org/project/subpathauto

Subpathauto was written to handle the case where those extra arguments at the end of the string are meaningful and the first portion of the string is an alias. For that to function it must use hook_url_inbound_alter (you were on the right track!) to look up the first section of the string.

Even if this module isn't an exact fit the code within it is a good starting point.