Wildcard domains on netlify


I’m building an MVP and trialling netlify as a place to host it.

The product is represented as:

The above are two seperate “sites” on netlify because there’s two repos.

This is easy. Where i’m struggling is the following:

I would like to redirect pages under example.com/store/:storename to :storename.example.com.

storename is dynamic.

I’ve setup a _redirects file which actually works, but when I land on :storename.example.com i get a 404.

/store/:storename/*  https://:storename.example.com/:splat  301

I have also enabled a wildcard CNAME entry in my netlify DNS (*.example.com)

I’ve also stumbled upon this helpful thread, but not helpful enough to fix my worries - Support for wildcard domains and multiple custom domains - if anything I’m a bit more confused.

2 questions:

  1. Is it true that if I use a wildcard entry (*.example.com) i would no longer be able to use something like app.example.com?
  2. Do I need to add some server side code (like a netlify function) to help this along?

Hi @charbs I can see we’ve responded to this request in our helpdesk. Please follow up there if you have further questions!