Rewrite URL to routing URL
If there is a node for each company, you can insert an alias when the node is saved.  Set up the alias created for each company to start with '/company/{company_name}', then when the alias is inserted, you can add a secondary alias for login:

/**
 * Implements hook__path_insert().
 */
function mymodule_path_insert($path) {
  if (preg_match('/company\/(.*)/', '/company/xyz', $matches) &amp;&amp; preg_match('/node\/(\d+)$/', $path['source'])) {
  $company_name = $matches[1];
    \Drupal::service('path.alias_storage')-&gt;save("/u/$company_name/login", "$company_name/login" $path['langcode']);
  }
}


This way, the visible path will be /{company_name}/login, but the machine name as far as Drupal is concerned with be /u/{company_name}/login.

You could instead do this on entity_insert and entity_update.