Disable default subdomain

My custom domain is served over Cloudflare. It makes certain changes to my page (for example, protecting all mailto links by rewriting them differently).

My problem is that the site is still accesible on the default netflify subdomain (name.netflify.app).

This makes the whole Cloudflare protection useless, because all mailto links are available there in plain-text.

Is there any way to disable the default subdomain?

hi there, does this help?

Yes I already saw that post. But I cannot get the redirect to work. I tried placing the file in the root and enabling “Pretty URLs”, but no effect. I tried placing it in /static, no effect. I will try /public now, but else I give up.

Okay, placing the file in /public finally worked!

However this still seems like a workaround. Because it is still possible for people to relate the subdomain at netlify to my main domain.

It was much better if the subdomain could be disabled entirely instead of redirecting it.

Hey @Muis

The <site-name>.netlify.app subdomain is used (even when you have a custom domain) for deploy permalinks, branch deploys and deploy previews e.g.

62971ab33a82fa6839c24030--<site-name>.netlify.app
<branch-name>--<site-name>.netlify.app
deploy-preview-<no>--<site-name>.netlify.app

so I don’t believe disabling the subdomain completely is on option here.

hi Muis,

as coel rightly assumed, disabling the default subdomain isn’t possible. I wish I had different news for you!