I’d like to capture the specific subdomain that’s being used to load my page and use it as a query parameter in a rewrite/proxy rule.
I couldn’t find anything in the documentation along these lines. Is this type of pattern matching possible?
I’d like to capture the specific subdomain that’s being used to load my page and use it as a query parameter in a rewrite/proxy rule.
I couldn’t find anything in the documentation along these lines. Is this type of pattern matching possible?
Not at present in any built-in way. There are some ways to handle it outside of a literal redirect, though:
If you use a proxy rule instead: Redirects and rewrites | Netlify Docs , then you’d be able to see the window.location.href
in your javascript and do something with it that way.
you could of course do a client side JS redirect and tack on ?original_url=$location
to the URL you redirect to, after storing window.location.href
into a variable.
We do support multiple hostnames on the same site so if you serve the destination site here, it may also be possible to just add a bunch of names to the site and serve them all directly?
I’d hoped to do it all via DNS and single round server side config. Back to the drawing board for now. Thanks!