By James Colley
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!
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!
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 setting DJANGO_ALLOWED_HOSTS environment variable to
127.0.0.1,localhost,mydjangodeploymenturl.ondigitalocean.app,www.mydomain.com,mydomain.com
And ensure you have the below in your settings.py
ALLOWED_HOSTS = os.getenv("DJANGO_ALLOWED_HOSTS", "127.0.0.1,localhost,mydjangodeploymenturl.ondigitalocean.app,www.mydomain.com,mydomain.com").split(",")
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.