Question

Multiple domain mapping on one WordPress site

I’m very new to DigitalOcean — I’ve only used shared hosting up until this point. Yesterday I finally decided to move my WordPress site over to DO. I wanted to start a fresh install so I used the one-click WordPress setup to create my droplet. I migrated my content, media, users, themes, etc. Most everything is running well, except for multiple domain mapping.

To be clear, I’m not running a Multisite WordPress installation. Instead, I’ve created landing pages in my WordPress install and mapped domains to them, essentially creating single-page websites/landing pages. (I need these domains to have their own website but each really only needs to be a single page. I’d rather manage them in my single site than create multiple sites for a couple of pages.) I use this plugin to set up the mapping: https://wordpress.org/plugins/multiple-domain-mapping-on-single-site/

I have two landing pages — all in all three web addresses, one of which is a subdomain. Here’s an example of the setup:

When I was on shared hosting, all I had to do was point the primary domain, subdomain, and the landingpage domain to my web server; set up the domains in cPanel; direct them to the WordPress directory using cPanel’s domain manager; and route the domains to the landing pages using the mapping plugin.

Right now my primary domain works and my subdomain is working as well (it’s going to the correct landing page). However, my second domain landingpagedomain.com is not working at all. I get a “This site can’t be reached — domain unexpectedly closed the connection — ERR_CONNECTION_CLOSED” message when trying to navigate to it.

Here’s how everything’s set up. I use Google as my registrar:

  • Primary Domain: Google is pointing to Cloudflare nameservers. In Cloudflare, the domain’s A record points to my droplet’s IPv4 address. I’m also using Cloudflare’s SSL.
  • Subdomain: This is created in Cloudflare using an A record, also pointing to my droplet’s IPv4 address.
  • Landingpage domain: The nameservers are configured in Google to point to DigitalOcean. I’ve added the domain to my droplet. I’ve pinged the domain and the correct IPv4 address is showing up, but nothing is still loading. It’s been 12 hours at this point.

Also worth mentioning: the subdomain landed on the primary domain’s home page until I added a .conf file to sites-available under apache2. That .conf file is essentially a copy of 000-default.conf, just with some values changed to match the subdomain. Once I did that, the mapping worked perfectly. I’ve also created a .conf file for the landing page domain but it hasn’t helped. (I’ve enabled both and I’ve restarted apache2 services many times as well).

Sorry for all the many details. I really don’t know what else to try at this point. Maybe my entire setup is wrong? I’m very new at this.

Also, if it helps, here are the actual domains:

Thank you!


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.

Hello,

I just came across this question. What I personally do is to create a separate Apache virtual host for each website, that way each website could have its own directory and files.

Here is a quick video on how to do that with the One-Click WordPress image:

Also regarding the transfer itself, keep in mind that once you change your DNS records, it might take up to a few hours for the DNS cache to clear over the Globe, before you could see the new records.

Best, Bobby