Let's explore how to add the path of a non-existent page as a query string parameter to a 404 page.
_redirects file is as follows:
/:language/invalid path=:path /:language/404 404
/:language/* /:language/invalid?path=/:language/:splat 301
/en/doh redirects to
/en/invalid?path=/en/doh which is configured to shadow the
The order of the rules is important, in order to avoid a redirect loop.
This could be easily amended to shadow a generic