Question

How to redirect www to non-www with DigitalOcean App platform on a static site

Posted July 15, 2021 146 views
DigitalOcean App Platform

I have a custom static site I have deployed that is pulling from a private repo on GitHub. The site is deployed at https://domain.com, but currently the https://www.domain.com is not working.

What is an easy way to get this to work? I have seen things about nginx and docker, but I am just running a simple static site.

Is there a way I can do this with a domain record? I am pointing to DigitalOcean name servers from a Google Domain.

Any help would be appreciated, thanks!

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.

×
Submit an Answer
1 answer

Hey there!

To add that www subdomain to your app you would need to add it under your app’s domain settings. If you are using DigitalOcean’s nameservers the correct CNAME should be created automatically. Any domain you wish to use with your app including subdomains would be added there. How to Manage Domains in App Platform