Support Forums

Redirect wildcard subdomain to a path

Hello, I understand that wildcard subdomains are available only to pro user and activated only by emailing customers. However I want to know if what I want to do is possible before migrating to netlify and upgrade to pro. I tried a demo repo but since it’s not on pro and doesn’t have wildcard subdomains enabled it doesn’t work.

What I want to do is:

I have a site where each one of my customers get’s a url which looks like this:
I want to allow them to connect their domain to this page, however they can’t connect to a path, they need a subdomain, so I want a redirect which redirects
from https://random-id.my-site.com to https://my-site.com/user/random-id
So that if they connect their domain to https://random-id.my-site.com they see the content of https://my-site.com/user/random-id.

This is the block on netlify.toml:
from = “https://*.my-site.com.com”
to = “https://my-site.com.com/user/:splat
status = 200

Will this work?

Hi @Cos,

No, this kind of a configuration won’t work. You might have some luck by redirecting using Netlify Functions.