I recently decided to change the domain name of my website. I have a lot of links to my old domain name and i dont want to lose them. So I want my new domain and my old domain both to point to the same website. This is not hosting multiple websites in one droplet. This is adding two domains to a single website in a single droplet.
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!
Set the DNS for both of your domains to point to your droplet.
Then configure two virtual hosts as follows:
<VirtualHost YOUR_IP_HERE:80>
ServerName www.new-domain.com
...etc...
</VirtualHost>
<VirtualHost YOUR_IP_HERE:80>
ServerName www.old-domain.com
Redirect 301 / http://www.new-domain.com/
</VirtualHost>
You can just point your new domain to the IP address of your droplet.
Maybe you also need to create a new vhost for your new domain.
Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.
Full documentation for every DigitalOcean product.
The Wave has everything you need to know about building a business, from raising funding to marketing your product.
Stay up to date by signing up for DigitalOcean’s Infrastructure as a Newsletter.
New accounts only. By submitting your email you agree to our Privacy Policy
Scale up as you grow — whether you're running one virtual machine or ten thousand.
Sign up and get $200 in credit for your first 60 days with DigitalOcean.*
*This promotional offer applies to new accounts only.