So I’m looking at the “Another option” mentioned here where I have a customer’s website hosted at mydomain.com/customer1
So customer would want to setup a custom domain like service.customer1.com. According to the “Another option” case in the above thread, does that involve me creating a separate site for the customer or I could add to the current site itself.
You can get “Wildcard subdomains” feature. It 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.
Currently our own DNS is hosted on Namecheap. So would I have to bring a wildcard SSL certificate or the customer? I’d want it do on my end on behalf of customer. So how to bring such a certificate?
And I couldn’t get the wildcard part. For example I have a customer’s website hosted on netlify configured with the domain of our website “https://brand.com/chapman” but the customer wants it on a domain like “https://chapman.com”, so how would that work here?
The second point in your list would not easily work. To do that, you’d have to add a domain alias for your site, and that has a list of about 95 aliases. If you’ve more customers, you’d have to setup a different site and add more domains there. Wildcard on the other hand, has no limit. You can get unlimited customer.your-domain.com.
So here with wildcard how does Nextjs find out the route? Internally Nextjs has [url] file where in case of “https://brand.com/chapman”, the url is taken as chapman but upon wildcard redirect of chapman.com configured on customer’s end, how would nextjs get the url path?