Subdomain -> Netflify app (subdomain.abc.tld -> netlify index.html with redirect to discord invite)

So basically, I own a domain, abc.tld.
I want to point a subdomain game.abc.tld to my netlify app I just now made.

I created a CNAME DNS record from my “game.abc.tld” to my netlify url “willowy-blancmange-XXXXXX.netlify.app

The app is this a simple index.js

<html>

<head>
  <title>Discord Redirect</title>
</head>

<body>
  <script>
    window.location.replace("https://discord.gg/MYCODE");
  </script>
</body>

</html>

If I enter my netlify URL manually into the browser it works fine, if I use my subdomain game.abc.tld this appears:

I tried to copy the url from my CNAME record, and paste. And it redirects fine as well. So it’s only the game.abc.tld - > netlify url that’s borked.

I have seen some google searches talking about “you have to add a custom domain in your netlify something” But I can’t find anything on my control panel, so if that’s the case please help me like im a 5 year old :stuck_out_tongue:

Best, regards!

You do need to add the subdomain to your site in the UI. To do so, navigate to the site itself > domain management > add a domain. If you have additional questions about this process let us know.

1 Like

Ah found it, thank you! :slight_smile: works now!

1 Like