For the purpose of what I’m looking for, imagine my users each have a username and I’d like them to be able to go to username.nftr.name and have my ReactJS app redirect to a specific resource, for example nftr.name/username taking in the subdomain as a wildcard. How is this achievable?
If I had a way of telling netlify DNS to send all *.nftr.name traffic to nftr.name but leave the subdomain wildcard in, I could then just parse the subdomain part and redirect to the resource myself.
Wildcard subdomains can be activated, but there are a few requirements:
The site must be on a Pro or above team.
The DNS must be managed by Netlify OR you need to bring a custom wildcard SSL certificate.
The site should not have any domain aliases or branch subdomains.
The primary domain of the website should be on the same level as the required wildcard domain. For example:
If you need the wildcard to be *.bar.domain.com where * can be your wildcard subdomain, the primary domain must be www.bar.domain.com (www can be replaced with any string).
You need to configure the DNS for the wildcard subdomain even in case you are using Netlify DNS. You can follow the external DNS configuration for subdomains and add a CNAME entry with * as the hostname or any other value that you want. The value of this DNS entry should be the Netlify site address.
If that sounds like something that would work, please let us know and we’d enable it for your site.
I have not switched over the DNS for the first one yet (it’s a little bit mission critical so want to switch DNS over once the wildcards have been enabled)
Also - do I understand correctly that if I switch the primary domain in the future, the wildcard will apply to any new primary domain on that site?
thanks! trying to migrate things over from a legacy SaaS deployment so all help will be much appreciated.
Hi, @yuchuwa. There is one key requirement that is missing here:
The primary domains for all the sites are apex domains (like example.com instead of www.example.com). For the wildcard subdomain feature to work correctly, the primary domain needs to be of the same depth where the wildcarding is needed.
If you make that change, we can enable this feature for these sites.
I was unable to set the primary domain as www (because the UI removes the www subdomain). However since you said the “www” can be replaced with any string, I suppose “base” will do as the subdomain suffix.
Please let me know when the wildcard subdomain has been added to the above domain. Once it works, we will do the rest.