Setting Up Onartline Multisite Domain Mapping

PluginsDomainsInstallation

Onartline Multisite Domain Mapping: How Every Website in Your Network Gets Its Own Domain

In the last post, you set up your WordPress network with subdirectories – since then, all your websites are reachable under subdirectories of the same main domain (e.g., your-domain.com/shop). For many projects, that’s completely sufficient. But as soon as a single website in the network should run under its own, individual domain – say, myshop.com instead of your-domain.com/shop – domain mapping comes into play.

With the free Onartline Multisite Domain Mapping plugin, you can set this up entirely without code changes. In this post, we’ll show you step by step how to install the plugin, configure it, and connect the first custom domain to a website in your network.

What Is Domain Mapping – and Why Do You Need It?

Within a Multisite network using subdirectories, all websites technically share the same main domain – recognizable from the outside by the URL structure with a subdirectory. For an internal area, a test project, or a collection of thematically related sites, that’s often exactly right.

But as soon as a website is meant to appear as a standalone offering – with its own brand identity, its own domain name on a business card, or independent marketing – a subdirectory of the main domain often feels out of place.

Domain mapping solves exactly this problem: it connects any domain you choose to a specific website within your network, so visitors land directly on that custom domain, without ever noticing the underlying network or subdirectory.

Requirements for Onartline Multisite Domain Mapping

Before you get started, make sure the following points are covered:

    • An activated WordPress Multisite network. The plugin won’t work on a single WordPress installation without an active network, since domain assignment is based directly on the site ID assigned by WordPress within the network.
    • WordPress 7.0 or higher and PHP 8.3 or higher. These requirements are deliberately set above the minimum requirements for a plain WordPress installation, since the plugin relies on current PHP features.
    • Write permissions in the wp-content directory, so the plugin can automatically copy the sunrise.php file there upon activation. This file is a key technical building block: it needs to load before WordPress itself initializes, so domain assignment already takes effect on the very first page load – which is why a normal plugin alone isn’t enough here.
    • A valid SSL certificate per domain, if you want to use HTTPS (recommended). The plugin itself doesn’t issue a certificate, but ensures HTTPS is correctly recognized and enforced within WordPress once a valid certificate is in place server-side.
    • Preferably a new Multisite installation not yet in production use. Onartline Multisite Domain Mapping is specifically designed for fresh networks; deploying it in an already active, production network afterward is not recommended, as it can lead to conflicts with existing domain configurations or other plugins offering similar functionality.

More information directly in the WordPress Plugin Directory

Ready to Get Started?

You can already download the Onartline Multisite Domain Mapping plugin here.

Setting Up Onartline Multisite Domain Mapping: Installation and Activation

Step 1: Install the Plugin

Since the plugin is now available in the official WordPress repository, the easiest way is to search for “Onartline Multisite Domain Mapping” directly under Network Admin → Plugins → Add New and install it with a single click.

Alternatively, you can upload the onartline-multisite-domain-mapping folder to the /wp-content/plugins/ directory, or install the plugin directly via Network AdminPluginsAdd New.

Step 2: Network-Activate the Plugin

Activate the plugin via Network AdminPluginsNetwork Activate. This matters: a regular activation on a single website in the network isn’t enough, since domain mapping needs to work network-wide.

Step 3: Set Up sunrise.php

If write permissions are sufficient, the plugin automatically copies the sunrise.php file to your wp-content directory – a success message appears in the Network Admin. If the automatic copy fails (for example, due to missing write permissions), you can do this manually:

  1. Copy sunrise.php from the plugin folder to /wp-content/sunrise.php.
  2. Add the line define( 'SUNRISE', true ); to your wp-config.php – it’s important that this line comes before the line require_once ABSPATH . 'wp-settings.php';. Only this way is sunrise.php actually loaded before WordPress itself initializes, which is essential for domain mapping to work correctly. You’ll find this section toward the end of your wp-config.php.

Step 4: Plesk Users – Disable “Preferred Domain”

If your server runs on Plesk, this step isn’t optional, it’s mandatory: disable the “Preferred Domain” setting for every domain you want to map. Otherwise, Plesk intercepts the redirect before WordPress can even respond – the result is redirect loops or a domain assignment that simply doesn’t take effect.

  1. Log in to Plesk
  2. Websites & Domainsyour domainHosting Settings
  3. Set Preferred Domain to “None”
  4. Save the settings

Step 5: Map Your First Domain

  1. Go to Network AdminDomain MappingAdd Domain
  2. Select the target website in your network
  3. Enter the domain (without http:// or https://)
  4. Optionally set whether this should be the primary domain, and enable HTTPS if needed
  5. Save

Step 6: Set DNS Records

For the domain to reach your server at all, the DNS settings need to be correctly set with the respective domain provider:

    • A record: @, value: your server’s IP address
    • CNAME record: name www, value: your primary domain or your server’s CNAME

The specific values for your server are shown directly in the plugin under Network Admin → Domain Mapping → Settings, so you don’t have to look them up yourself.

Features at a Glance

  • Domain assignment via site ID: Every website in the network can be connected to, changed, or have its own domain assignment removed using its WordPress-assigned site ID – with no need to touch the database or write code.
  • Primary domain with automatic redirect: When visitors access a non-primary but assigned domain, they’re automatically redirected to the main domain you’ve set – consistent, and without duplicate content for search engines.
  • Automatic HTTPS with 301 redirect: Insecure HTTP requests are automatically redirected to the secure HTTPS version via an SEO-friendly 301 redirect, provided a valid SSL certificate is in place.
  • Management by site administrators: Optionally, the Super Admin can allow individual site administrators to manage their own domain settings under Network Admin → Domain Mapping → Settings → Site Admin Domain Mapping.
  • Automated background maintenance: An hourly, network-wide cron job cleans up expired login tokens and checks all stored domain assignments for reachability. For higher-traffic websites, it’s recommended to replace the built-in WordPress cron with a real server cron job, since it’s more reliable and resource-efficient.
  • Object cache compatibility: The plugin works with common object cache solutions like Redis or Memcached, which noticeably improves load times, especially for networks with many assigned domains.

The Plugin Isn’t Working – Here’s What to Do

Answer: This is usually caused by a duplicate redirect – for example, when “Preferred Domain” in Plesk and the plugin’s 301 redirect are both active at the same time. First, check whether “Preferred Domain” is really set to “None,” and whether define( 'SUNRISE', true ); is correctly present in wp-config.php.

If your hosting already applies its own 301 redirects for the domain and you want to keep those, disable the 301 option in the plugin instead, to avoid duplicate redirects.

Answer: Copy the file manually from the plugin folder to /wp-content/sunrise.php and add define( 'SUNRISE', true ); to wp-config.php, as described in Step 3.

Answer: When uninstalled, the plugin automatically removes its files as well as sunrise.php, but it can’t remove the line define( 'SUNRISE', true ); from wp-config.php itself. If that line remains, WordPress will keep trying to load the now-missing sunrise.php – in that case, remove the line from wp-config.php manually.

Frequently Asked Questions About Onartline Multisite Domain Mapping

Answer: We recommend against it. The plugin is designed for new Multisite installations. If you’re already running an active network, we recommend first setting up a new WordPress Multisite installation and installing and configuring the Onartline Multisite Domain Mapping plugin there. You can then migrate your existing content to wherever you’d like it.

Answer: With the subdirectory structure, all websites share the main domain and only differ in their subdirectory. Domain mapping adds to this the ability to assign individual websites within the same network a completely independent, custom domain on top of that.

Answer: Yes, for HTTPS to work on a mapped domain, a valid SSL certificate for that exact domain needs to be in place server-side. The plugin correctly detects and enforces HTTPS, but doesn’t issue the certificate itself.

Answer: Yes. The plugin is published in the official WordPress plugin directory, so automatic updates work as usual through the WordPress admin, just as you’re already used to with other plugins. You can find out what each new version brings in our continuously updated Changelog.

Answer: No, the plugin is completely free to use – including unlimited domain assignments, automatic HTTPS, SEO-friendly 301 redirects, and full Multisite compatibility. There are no hidden costs, and no credit card is required.

Answer: Installing and setting up the plugin takes no more than 5 minutes before you can start mapping and routing your first domains. This assumes, of course, that you’ve checked everything beforehand so the plugin installation goes smoothly.

Conclusion

With that, you’ve successfully set up Onartline Multisite Domain Mapping. With Onartline Multisite Domain Mapping, every website in your WordPress network can be made reachable under its own, individual domain – with no manual code changes or complicated server configuration required.

Combined with the subdirectory structure from the previous post, you now have a complete, free solution for managing any number of independent websites centrally through a single WordPress installation – while giving each individual site its own custom domain presence.

Tags: Domain Management, Domain Mapping, Multisite Network, Subdomain, WordPress for Beginners, WordPress Multisite, WordPress Plugin, WordPress Security
Domain Mapping WordPress – How to Properly Manage Multiple Domains
Onartline Multisite Domain Mapping – Changelog
About the Author
You might also like:
Do you like this article? Share it with your friends!

Related articles: