Domain not working

Just wondering if a member of staff can remove my domain linked to the project CMB because I want to link it to another project

Edit
TOPIC CHANGED

Hey @Callum-OKane can you please confirm the domain name you want removed as well?

catmaniabot.tk is the domain

Deleted! Did you also want the www subdomain removed?

Yes please :), and thanks!

www.catmaniabot.tk is also removed!

I have a new error, I have successfully setup my project with fly.io, and have followed the tutorial correctly, but on my webpage, I get this

It looks to me like your domain is set up properly for www.catmaniabot.tk. Perhaps the project it’s linked to isn’t handling the “/” route or is otherwise responding with an HTTP 404.

How can I fix this? I really want to get the page up soon! :slight_smile:

Can you let us know the project name? It seems like it’s not cmb any longer, right?

The Project name is now CatManiaBot

Ok. it looks like you’ve added catmaniabot.tk to the project, but not www.catmaniabot.tk. It also looks like you have everything properly set up for catmaniabot.tk in DNS, so https://catmaniabot.tk/ seems to work fine.

If you go to the project and add www.catmania.tk to your project (it doesn’t seem to be associated with any Glitch projects, at least not on our end of things) then I think that will start resolving. If you’ve set it up in fly.io directly then you might need to have them associate it with your Glitch project, or ask them to remove it and add it from within Glitch (personally I think this option is your best bet - at some point we expect to improve the interface for this stuff in Glitch, and having everything set up in Glitch will mean that when we get there you’ll get the full benefits)

1 Like

Thanks, this really helps me understand more about domains aswell now. :slight_smile:

So if I were to do that, would I have www.catmaniabot.tk, and catmaniabot.tk, or just the one with www

That’s up to you in the long run - it all depends on how you want to use your domain. Since you’ve got the “apex” domain (catmaniabot.tk) already set up, I’d suggest leaving that one. If you’re not going to be sending folks to www then you don’t necessarily need that, but it’s pretty common practice to have both working.

Do you know how I can have www.catmaniabot.tk redirect to catmaniabot.tk

I think you could write an itty-bitty middleware for Express that handles redirects. https://medium.com/letsboot/basic-redirect-with-expressjs-f5acedf0ba9b looks like a promising start; something like this ought to work:

function handleRedirect(req, res, next) {
  if(req.headers.host == 'www.catmaniabot.tk') {
    res.redirect('https://catmaniabot.tk');
  } else {
    next();
  }
}

app.use(handleRedirect);

Let me know how it goes!

Could this also work?

That won’t cause a redirect, but it will make sure both www.catmaniabot.tk and catmaniabot.tk will show your project.

Cloudflare might be able to handle the redirect for you, though; I don’t use them so I’m not that familiar with their services.

Ok, if it means they both work, then I am happy with it that way! :smile: