Wildcard DNS Settings

SiteName(s):
golf918-booking.netlify.app
golf918-admin.netlify.app
golf918-pos.netlify.app
golf918-backoffice.netlify.app

New to Netlify. We’ve been struggling with getting DNS set up correctly in an efficient manner. I’m hoping someone can just explain it here.

We are building a multi-tenanted application set with vanity DNS by customer.
We have 4 applications: a booking tool, admin, point of sale, and a backoffice application, in a mono-repo.
Our DNS is golf918.net (currently with CloudFlare).

Desired URLs per app:

  • Booking: *.golf918.net
  • Admin: *.golf918.net/admin
  • POS: *.golf918.net/pos
  • Backoffice: backoffice.golf918.net
    The wildcard represents a customer (ie: foo).
    We also have api.golf918.net for our heroku-based backend.

For builds based off our dev branch, we want to have stage appended to the front of the APEX host name. So it would be:
Booking: *.stage.golf918.net
Admin: *.stage.golf918.net/admin
POS: *.stage.golf918.net/pos
Backoffice: backoffice.stage.golf918.net

I couldn’t get any of this to work with Netlify DNS, so I set up CloudFlare and got it sortof working there, but I can’t get the wildcard functionality to work easily, and the redirects to the routes /admin and /pos do not work.

We added a netlify.toml file to our base repo for the booking application (we are a mono-repo, so it is in the packages/X subfolder for the booking application, linked to the DNS we want, where we want to redirect to admin or pos applications based on those routes. We get an error / 404 with the following config.

[[redirects]]
from = “/admin/*”
to = “golf918-admin.netlify.app/:splat”
status = 200
force = true

[[redirects]]
from = “/pos/*”
to = “golf918-pos.netlify.app/:splat”
status = 200
force = true

[[redirects]]
from = “/*”
to = “/index.html”
status = 200

I am confused as to where to put config. There is a general DNS section, and there are application-level DNS settings. And now I also have CloudFlare config. Our back-end is hosted on Heroku so there is also an api.golf918.net URL to manage as well.

Hoping for clear instructions on how to proceed.