A photo of Phil Hawksworth's face
Phil Hawksworth @philhawksworth replying to this from @DavidDarnes
@DavidDarnes @chriscoyier @cloudinary @Netlify Oooh that's a thought! A build plugin (or just a build script which performed logic based on the CONTEXT environment variable) could generate a couple of lines of _redirect config to do this quite nicely!

https://docs.netlify.com/configure-builds/environment-variables/#build-metadata

My tweets and posts live here on my own domain these days.
You can explore them here and follow me on Mastodon instead of Twitter where I'm not currently active.