Report this

What is the reason for this report?

How to redirect traffic from www to root domain on app platform?

Posted on May 7, 2021

I deployed my django app successfully on App platform. I added my root domain. The challenge I have is users who access web app with www included are shown a cloudflare page: ERROR 1: DNS RESOLUTION ERROR. I added www as a CNAME record but things are not working. Digital ocean support agents have not been helpful on this



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!

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.

Hello, App platform can not redirect the www request to non-www request. Either you will have to configure the www domain in your App like you have set up the root domain or you can set up and droplet with Nginx or apache where you can redirect the www domain to the root domain.

https://www.digitalocean.com/community/tutorials/how-to-redirect-www-to-non-www-with-nginx-on-centos-7

https://medium.com/@kandros/redirect-www-traffic-to-non-www-with-ubuntu-and-nginx-9f05281ef944

Thanks Mohsin Saeed

This comment has been deleted

But this does not solve the problem. It should be redirected to https://domain.com but it does not. With this configuration https://www.domain.com is also working without redirection.

Again the same question: How to make a redirection from www to non-www domain ?

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.