Hi folks, I’m in the beginning stages of porting willarrive.in to Netlify from the monster that is AWS. One of the key features of the site is wildcard subdomain routing. When a visitor hits f.willarrive.in, we serve the same HTML structure to the user but with “f-related” content.
I suspect this is a combination of wildcard subdomain setup and functions that serve HTML. Here’s what I’m thinking:
[[redirects]]
from = "/*"
to = "/.netlify/functions/index"
status = 200
force = true
Thank you. I do have one additional question. If the domain entered does not have a subdomain, where would the DNS direct traffic when the wildcard subdomain is active? Would that be triggered by the handler as well?
I’m not sure if I understand that question perfectly, but once wildcard domain is enabled (and you add a wildcard entry in your DNS config), all subdomains, unless explicitly configured otherwise will be served by the same site. Once they reach your site, based on the configuration you shared, they will all go to the serverless function.
Ah okay. Well, If you have added www as the primary domain to a site, the apex domain also needs to be added to it. Assuming you enable wildcard on the same site, that site will serve willarrive.in as well as *.willarrive.in. If you add another domain like app.willarrive.in, and willarrive.in is not connected to any site, that won’t be served.