Disabling language prefix for route in module How can I disable the automatic redirect to the language prefixed URL for a URL defined in a routing.yml in my module?
I'm developing a custom sitemap.xml module, because the Simple Sitemap XML module does not have the options I need. I've got it just about working, except the URL /sitemap.xml 301 automatically redirects to the URL /lang/sitemap.xml - and it really shouldn't. How can I disable this redirect?
Yes, has to be redirect.module, core doesn't do that. See https://www.drupal.org/node/2854462#comment-12047347, just add the '_disable_route_normalizer' flag to your route and you should be fine.

module_sitemap.routing.yml:

module_sitemap.sitemap:
  path: '/sitemap.xml' 
  defaults: 
    _controller: '\Drupal\module_sitemap\Controller\SitemapController::view'
    _title: 'View Site Map'
    _disable_route_normalizer: 'TRUE'