I'm trying to run two sites on the same droplet, but my new virtual host seems to be having no effect? (Configuration files inside)

I’ve had a website running on my droplet for sometime, and now I’m trying to set up a second on the same droplet but with a new domain name.

I’ve set up the directories, created virtual host files for each site, and enabled both sites.

Currently, every time I visit the new domain,, I get 301 redirected to If I disable the site using a2dissite, then loads as expected. So it seems as though the virtual host for the original site is overriding the new one when enabled?

Here are my virtual host files:

Main site which works, and which the other domain is redirecting to:

New site which always redirects to main site:

And my ports.conf file if that might help in any way:

I’ve spent hours trying to find a solution but with no luck : /

Thanks for any help.

Submit an answer

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!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

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.


Did you check the webserver logs ? What do the logs have to say ? Could you share your error logs on pastebin ?