Number one is possible; it is a feature available for sites on the Pro plan (see Netlify Pricing and Plans), and our Support team must explicitly enable it on your site. There are some conditions, but that is the starting point. I’ll be happy to go into details if the price point and my next answer aren’t a deal breaker.
Number two is only possible when rewriting to the same hostname that we host. For instance:
yourclient.yourcompanysitehostedonnetlify.com/api/* could rewrite to yourclient.yourcompanysitehostedonnetlify.com/otherpath/*…but not to yourclient.asitehostedelsewhere.com/anything . The hostname is not available as a “parameter” in the redirect in any way.
and redirect a list of sub-domains to their existing sites (this is because I currently have many customers occupying explicit sub-domains)
Never mind about all that.
So really, here’s our one true requirement:
Host a multi-tenant Netlify (w/ NextJS) site (for customers) on all subdomains of a domain e.g. *.mydomain.com points to a netlify site (which dynamically renders data, depending on the sub-domain.
We have most if not all DNS and things configured already:
We’re on the pro plan
The domain we want a subdomain wildcard for is already managed by Netlify DNS (enabled ipv6 too)
We added a CNAME record with * and the value as the netlify app domain
The primary domain for the site is set to myfuturestay.com with the www site redirecting.
But the wildcard isn’t working as expected. When visiting any subdomain we get a blank page responding with Not Found - Request ID: 01GGGGB3NXDVWTGVHJTPW4KBA4.
So:
Does the primary domain need to be the www domain?
Do you need to turn the feature on for our site? If so, can you please do so for: myfuturestay.com
Or what else do we need to configure to get this working?
www or any domain as the same level of the required subdomain. For example, www would do if you want *.example.com, but if you want *.foo.example.com, the primary domain should be www.foo.example.com. You can replace www with anything.