Hi, I’m trying to get my domain setup with a droplet so that when you enter in “domain.com” it will go to “www.domain.com”. I used to use a wildcard CNAME, but that didn’t work, and setting up the A record with the www prefix doesn’t seem right (after digging around on the internet)
What am I doing wrong? Also, neither version of the site loads on Safari, but the www.domain.com loads on chrome. Weird.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
This question was answered by @olavamjelde:
Hi, DNS changes can take many hours before it’s updated. So if you think you set it up right, you have to wait and see.
For my set up I have just set up A-name records that point to my floating ip. The floating IP points to the VPS. You dont have to have a floating ip, but it makes it possible to switch servers in the future without waiting for DNS-changes. Also you can make failover clusters etc.
inside nginx I have a server block that listens for both www.domain.tld and domain.tld Then I have another server block for redirect (https).
In theory I could have one block for www with redirect and one for just domain.tld. There are many options, but you have a simple thing that ties it together:
- DNS point A-name to the IP that works for your server.
- Server has to listen for domains
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.