Our company recently went through a rebrand resulting in a change of domain.
We previously had users accessing our app (Ubuntu droplet with NodeJS) via app.olddomain.com.
I have successfully updated the DNS to have the droplet be served on app.newdomain.com instead (which is working completely fine), but would like anyone who mistakenly goes to the old access point (app.olddomain.com) to be redirected to the new subdomain (app.newdomain.com).
DNS is being managed through DigitalOcean, and both domains are purchased through Google Domains.
I have tried a CNAME, but I am seeking a true redirect than an alias.
One option I have considered is hosting a LAMP droplet on app.olddomain.com and use Htaccess to do a 302 redirect, but that seems silly hosting and paying for a droplet just for that purpose.
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.
Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.
Click below to sign up and get $100 of credit to try our products over 60 days!