I have pointed the domain name servers to DO and I am trying to get the www subdomain to point to the naked domain. I have tried CNAME and A host but not luck. Is there a simple/straightforward way of having the www subdomain redirect or point to the naked domain?
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!
Through DNS you can point the www.domain.com record to the same one as domain.com.
After that you want when someone loads www.domain.com to redirect to domain.com, correct? If that’s the case, this redirect happens on a server level. You’ll need to put the redirect in Nginx or Apache2 depending on what you are using. The redirects are rarely done via DNS but from the server your app is being managed.
Hello @massiveseagreenray
If you’re using Nginx, take advantage of our NGINX tool and specify the redirection there.
https://www.digitalocean.com/community/tools/nginx
For Apache, you can do a basic 301 redirect rule in the .htaccess file or in the virtual host for the domain name.
Regards
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.
From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.