Question

How to redirect www.mydomain.com to a naked domain when using App Platform?

Hi team: I just signed up for App Platform and my app is already running… very impressed!

I went into my domain name provider settings and changed all the nameservers to match Digitalocean’s ns1/ns2/ns3 names servers.

All is well and I can see my webapp at https://mydomain.com. This is exactly what I want (a naked domain).

However, I am not sure if/how it is possible to redirect users to the naked domain if they should visit https://www.mydomain.com. Is it possible with Digitalocean?

My domain provider provides some of these options, but I think it would require that I switch my domain’s name servers back to theirs; I would prefer to keep using Digitalocean’s name servers.

Thanks!


Submit an answer


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!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

alexdo
Site Moderator
Site Moderator badge
March 26, 2023

Hello @jamescolley

You can setup a CNAME record for the www version of the domain namne. CNAME records define aliases for A records by pointing one domain to another domain instead of to an IP address.

https://docs.digitalocean.com/products/networking/dns/how-to/manage-records/#cname-records

As for the https redirection, the domain will automatically be redirected to HTTPS and there are no changes required from your end.

Hope that this helps!

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up