Report this

What is the reason for this report?

How to point non-www domain to www

Posted on February 23, 2021

Hello,

I have a Rails app deployed to the DO App Platform and I added my custom domain and pointed the name servers to DO. But the problem is that I want any requests coming to mydomain.com to be redirected to www.mydomain.com, and I already configured the app to handle this 301 redirect. But I still couldn’t get this to work.

I’m aware that there are many other posts about this problem but none of them helped me. Any ideas?



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, @bikmazefe

I believe a similar question was asked before in our community. You can check the original question here:

https://www.digitalocean.com/community/questions/app-platform-how-can-i-redirect-non-www-to-www

Regards, Alex

Hi @bikmazefe

At the moment it’s kind of tricky to have to redirect. There are multiple questions where this has been asked. Just like Alexdo has provided you with some similar questions here are a bit more that can help you in your search:

https://www.digitalocean.com/community/questions/redirecting-root-domain-to-www-app-platform

https://www.digitalocean.com/community/questions/how-to-setup-cname-to-redirect-static-app-platform

https://www.digitalocean.com/community/questions/how-to-redirect-301-on-the-digital-ocean-apps-platform

Regards, KFSys

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.