Wildcard Subdomains routed to main domain only


I was wondering if it’s possible to add wildcard domains which are routed to the main site with Netlify?

Main website - site.co.uk
Sub Domain - Web.site.co.uk -> which is then redirected to the above.

Many thanks, Aidan

you can do that as you describe - for a single hostname - today. takes two configurations:

  1. add the subdomain name to the domain settings for your site (in addition to the main domain, and the auto-added www.maindomain)
  2. add a redirect (https://docs.netlify.com/routing/redirects/) from the subdomain to the main domain. For your example (please note that all hostnames need to be in lowercase):
https://web.site.co.uk/* https://site.co.uk/:splat 301!

If you need true wildcard support - we automatically serve anything.site.co.uk - that is a paid feature, but I think you just mentioned that word, don’t need that feature. Do let me know if I guessed wrong and I can explain in more detail how that config works.