William William - 2 months ago 6
Node.js Question

DigitalOcean: Domain works with www. but not without?

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

http://sparkles-cakes-of-art.co.uk
to register as
http://www.sparkles-cakes-of-art.co.uk
.

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
www.
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:

A
@
138.68.141.28


CNAME
www
www.sparkles-cakes-of-art.co.uk.


(For the same CNAME, I put in
@
, and DigitalOcean automatically changes to
www.sparkles-cakes-of-art.co.uk.


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.

Answer

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 @

Comments