I have several domains pointing at one droplet for our company website. Currently which ever the domains you type in the site loads always showing the same domain, ie .com and .design domain loads .org in the browser.

I need to change which domain is shown as the default address, i want the .com address to be the address shown in the browser so if you type the other ones you are shown the .com.

My site is setup as a wordpress site and I tried changing the Website Site Url within wordpress but this didn’t stop the redirects happening (I dont have any redirects or forwards setup). ie site would still redirect to the .org address but now the css and images wouldn’t load as the links to the files had been changed to .com. As far as I know the only setup that I have done is point the 3 domains to the same droplet.

Was this the right approach but i need to allow more time for the changes and servers etc to reflect this or is there another way to achieve my goal.

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.

×
1 answer

Hi there @iamleeadamson,

In order to get this working, you need to configure your web server as well.

If you are using Apache, you need to follow this guide here on How To Set Up Apache Virtual Hosts on Ubuntu 16.04 and host multiple websites on one server:

https://www.digitalocean.com/community/tutorials/how-to-set-up-apache-virtual-hosts-on-ubuntu-16-04

Or if you are using Nginx, you need to follow this guide here:

https://www.digitalocean.com/community/tutorials/how-to-set-up-nginx-server-blocks-virtual-hosts-on-ubuntu-16-04

Hope that this helps!
Regards,
Bobby

by Brennen Bearnes
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 16.04 server.
  • Hi thanks for your reply @bobbyiliev , however I don’t want separate sites on the same server i simply want the 3 domains pointing at the one site and all domains resolving to the same url…

    • Hi there,

      Are you planning to build a WordPress multisite or do you have just 1 site and want to have different domains pointed to that 1 site without being redirected?

      If this is the case, I believe that you would need to setup reverse proxy for your sites, so that in the background your requests are forwarded to your main site. Otherwise, without a reverse proxy, your sites will always be redirected to the main site as this is how WordPress handles the requests I believe.

      Regards,
      Bobby

Submit an Answer