[resolved] Have 2 sites on 1 vps, trouble with www. appended (3 posts)

  1. michael.chun03
    Posted 1 year ago #

    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 (michaelgchun.com) was successfully installed into the /var/www folder, and the second site (thisisformusic.com) is installed in /var/www/secondsite.

    The problem I have is that when I try to access http://www.thisisformusic.com , it shows the same site as michaelgchun.com. When I use thisisformusic.com 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 'www.site2.com' to 'site2.com' 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 'www.site1.com' leads to site1.com but 'www.site2.com' remains as 'www.site2.com' with the content from the site1 is displayed.
    Does anybody know what might be the problem?

    Thanks in advance,

  2. jonradio
    Posted 1 year ago #

    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.

  3. michael.chun03
    Posted 1 year ago #

    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!


Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.