Question

Can I redirect a domain towards another, both pointing towards the same App

Hello everyone,

I have a DO App and I currently use two sub-domains, let’s say beta.example.com and my.example.com, that point towards the APP with a CNAME record.

After using the beta subdomain for a while, I now want to make the my.example.com subdomain the default one. Can I redirect all beta.example.com requests to my.example.com using DO ? I already searched if that was a feature available at the DNS level of my domain provider but no luck.


Submit an answer


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!

Sign In or Sign Up to Answer

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.

KFSys
Site Moderator
Site Moderator badge
February 13, 2024

Heya @support0ce4966f9e47942ec54621b,

You can partially do this with URL Redirects.

See: https://docs.digitalocean.com/products/app-platform/how-to/url-rewrites/#configure-a-redirect

The thing is, you need a route to be configured to a component (specifically for /docs and /api). App Platform doesn’t currently support domain only matching for components, so you’d either need to host those as separate apps with different domains OR redirect to beta.example.com and my.example.com (or similar).

The other way would be again using CNAMEs or using DigitalOcean Droplet to redirect the request from there.

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Featured on Community

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more