2 dns pointing to same website + wordpress in subfolder

May 31, 2016 543 views
WordPress DigitalOcean DNS

hello,

i am running a single wordpress installation in a droplet www root folder. the first question is how to point a 2nd dns to this existing website? i found this: https://www.digitalocean.com/community/questions/multiple-domains-for-one-website-2
would it work to address this problem?

the second thing i would like to do is make a new subfolder in www to host a 2nd installation of wordpress, where i will upload an existing wp site.

2 Answers

Hey. That answer covers how to redirect a second domain name to the first one. WordPress will take care of most of this for you. If you point more than one domain name to your droplet's IP, by default they will all serve your default site.

You can add a second site by creating a virtualhost entry (assuming you are using Apache, server block if you are using nginx). This guide will walk you through that process. When you are hosting more than one site on your droplet you will want to make sure you have proper ServerName and ServerAlias entries for each domain so they are routed to the correct site.

by Justin Ellingwood
The Apache web server is the most popular way to serve web content on the internet. Apache has the ability to serve multiple domains from a single server by using a mechanism called "virtual hosts". If a virtual host is configured correctly for each domain, the web server can correctly route traffic to the appropriate files based on the domain name requested. In this guide, we'll demonstrate how to configure Apache virtual hosts on an Ubuntu 14.04 VPS.
  • hey, thanks for the answer!
    so as i understand, i can just point both domain names to my droplet IP in the D.O. panel, that will take care of my main site. then i should make a subfolder in my public_html where i can have a 2nd installation of wordpress, right? i dont mind to have it as "www.example.com/2ndwordpress" Im assuming ill have to create a 2nd database for it too, correct?

hey, thanks for the answer!
so as i understand, i can just point both domain names to my droplet IP in the D.O. panel, that will take care of my main site. then i should make a subfolder in my public_html where i can have a 2nd installation of wordpress, right? i dont mind to have it as "www.example.com/2ndwordpress" Im assuming ill have to create a 2nd database for it too, correct?

Have another answer? Share your knowledge.