How to redirect requests outside configured domain names?

Hi,

I have a single‐tree, two‐language setup with path‐only domains /se (default) and /en. I’d like any request not beginning with /se or /en to be permanently redirected to /se/ (the domain with the default language). For example:

  • A request to / or /foo/bar should redirect to /se or /se/foo/barrespectively.
  • A request to /se/page or /en/page should continue as normal.

What’s the recommended way to catch these and perform the redirect? Would you use an IContentLastChanceFinder, custom middleware, or something else? Any simple examples or pointers would be really helpful.

Thanks in advance!