I’m looking to move my multitenancy project (frontend) to Netlify.
But I’d like to know if it’d support the features I need.
Is it possible to have wildcard subdomains E.G. .mystore.com pointing to the same site.
Can I still have a fixed subdomain like api.mystore.com as an A record in my domain pointing somewhere else (To the API outside Netlify).
Not a requirement:
3) Is there any way to have a wildcard in the domain mapping. E.G .api.mystore.com pointing to the API somewhere else.
4) if the above is possible, Is there any way to append a header to all requests with the subdomain?
Wildcard subdomains are possible with a paid account, and you must either use Netlify DNS so we can get you a wildcard SSL cert, or you must bring a custom wildcard certificate. If these conditions are met, then yes, it’s possible for the subdomains to point to the same site.
Yes, if we’re managing your DNS, you could certainly add an A record pointing to your API.
Basically, squashing questions 3 and 4, what I want is something like this (DNS will be on netlify):
api.store.com > A record redirecting to my API
*.api.store.com → A record redirecting to my API, appending a header [x-store-id] which is the wildcard used
*.store.com → NETLIFY to my webstie
Hey @ighormartins,
Thanks for your patience on this! Here’s what will work: http://api.store.com > A record redirecting to my API *.store.com -> NETLIFY to my webstie
For pointing *.api.store.com to your API, we’d recommend a CNAME record over an A record. Re: appending a header, there’s not a way to dynamically grab the sub-subdomain and send it in a header unless you use Netlify Functions, which is just adding more stuff (network travel time, build time, etc.) than necessary. We’d recommend getting the subdomain name client-side, parsing it, and then redirecting (again, client-side) by appending that as a query parameter. Would that work for you?