I have currently a problem with the whole domain thing. What i want to achieve is that my app on app platform is accessible from mydomain.com and www.mydomain.com but the root should always redirect to the www subdomain.
What i did before was i added both domains on namecheap and then the app was accessible from root and www. but since i use localstorage in my app that is a problem. and if i just added www and redirected the root to that it was only possible with http://mydomain.com and not https://mydomain.com.
How could i solve this? Would it be easier if i let DO manage my domain (nameserver) and what records would i have to add then
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.
Click below to sign up and get $200 of credit to try our products over 60 days!
Yes, letting DigitalOcean manage your domain might make the process easier because it allows you to manipulate DNS records directly from their dashboard.
However, regarding the redirect itself from the non-www to the www version of your domain, I don’t think that it is currently natively supported by the App Platform. You could handle the redirect on your the application level rather than the App Platform itself.
Depending on the language and framework you’re using for your app, the method to implement the redirection will differ.
For example, in a Node.js Express app, you could do something like this:
I recently answered a similar question about Django as well.
Feel free to share more details about the framework that you are using and I will be happy to make a suggestion!
The best thing to do to get your voice heard regarding this would be to head over to our Product Ideas board and post a new idea, including as much information as possible for what you’d like to see implemented.
Hope that helps!