Support » Localhost Installs » Have 2 sites on 1 vps, trouble with www. appended

  • Resolved michael.chun03


    Hey all, I just started trying my hand at wordpress and ran into a problem I can’t figure out. My goal is to have two separate wordpress blogs on one VPS (one for ‘professional’ use and one for fun).

    The VPS is from Digital Ocean, and has LAMP (Linux-Ubuntu 12.04, Apache, MySQL,PHP) installed. The first website ( was successfully installed into the /var/www folder, and the second site ( is installed in /var/www/secondsite.

    The problem I have is that when I try to access , it shows the same site as When I use without the www. appeneded to the front, I am able to see the secondary site I want to see (at the moment it should be the stock theme with the hello world post).

    Here are some things I have tried so far:
    – modifying the .htaccess file in both the root folder and the second site folder. I’ve used multiple, similar code found on stackoverflow and wordpress forum searches, but all have lead to the same result, which is the site being completely unaccessible.
    – modifying the virtualhost files created in the apache folder (/etc/apache2/available-sites).

    I was thinking that being able to redirect ‘’ to ‘’ would do it, but as mentioned playing with the .htaccess file didn’t work out for me. Perhaps it’s a DNS issue? I thought it was strange that ‘’ leads to but ‘’ remains as ‘’ with the content from the site1 is displayed.
    Does anybody know what might be the problem?

    Thanks in advance,

Viewing 2 replies - 1 through 2 (of 2 total)
  • In my experience, you will save yourself a lot of grief if you have each domain name “at the same level” in different subdirectories.

    I had a great deal of success using the documentation here:

    I used the “Name-based Virtual Hosts” to keep the two domains completely separate.

    Oh wow thanks a lot jonradio, that did the trick! That site is pretty informative too I like how they actually explain what the commands do, I’m pretty new to all of it so the extra detail was helpful. Thanks again for the super fast response, I really appreciate it!


Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Have 2 sites on 1 vps, trouble with www. appended’ is closed to new replies.