William William - 4 months ago 13
Node.js Question

DigitalOcean: Domain works with www. but not without?

I'm having an issue with the domain where I cannot get

to register as

I have searched a lot on this issue over the past hours and everyone seems to have the opposite issue, where they cannot get the website working with the
in the URL. There has been 1 instance I came across the same issue here but that solution didn't work.

My records are as follows:



(For the same CNAME, I put in
, and DigitalOcean automatically changes to

I've read this may have to be fixed at web server level. In which case how do I do this, using NodeJS, Express? I've messed with a few solutions here too but it seems I don't even reach the server from the non-www URL for it to do anything.


So basically I feel like an idiot, but maybe my idiocy will serve someone else in the future. Here is the answer to those having the same issue.

When using DigitalOcean, on this page (Networking page, in case link dies):

Networking Make sure you do not have the www. in the domain. Remove the www. if it's there by adding another domain and it will work.

You may run into the reverse issue (where you now can't access the www. link) but it is far easier fixed and there's loads of discussion about it. Basically to fix this add a CNAME like www @