Hey all. I have a WordPress site named example.com. I have a subdomain, via WordPress Multisite, called sub.example.com. I have mapped sub.example.com to foo.com.
When I access the dashboard as well as visit the public-facing site for sub.example.com, all plugins and functionalities work as expected. However, when I do the same for foo.com, they don’t.
In the dashboard for foo.com, the Visual Editor is “whited out.” When I visit the public-facing site, my syntax highlighter plugin (which works on sub.example.com) doesn’t apply.
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.
The following information will only apply if you’re currently using the WordPress MU Domain Mapping Plugin (link). You can verify this by logging in using your admin account and then by visiting:
My Sites » Network Admin » Plugins
If you see a plugin named WordPress MU Domain Mapping, we’re good to go :-).
First off, there’s quite a few custom modifications to your wp-config.php file. To ensure that those modifications are not causing the issue (or any other issues), please make a backup copy of your current wp-config.php file and store it in a safe place (Dropbox, Box, Google Drive, etc). Leave this copy alone and download another to edit.
Now wipe the one you’ll be editing clean (blank), copy and paste the code from the following PasteBin in to it, and save. You’ll need to fill out some of the values with your own. You can use your backup copy to reference these values. Specifically, you’ll need to add your keys and salts back in place of the blank ones and replace all instances of YOUR_* with your actual values.
The above is pre-configured for WordPress Networking and the WordPress MU Domain Mapping plugin already, so no further modification should be needed as everything that needs to be in there, is.
Now, like you did for your wp-config.php file, download a copy of your .htaccess file and store this copy in the same place as your backup wp-config.php. Now download another copy to edit, wipe it clean and replace it with the code from the following PasteBin and save it.
Now, we need to make sure that you’ve configured the WordPress MU Domain Mapping plugin as it needs to be, so first thing we need to do is head over to:
My Sites » Network Admin » Settings » Domain Mapping
You’ll need to add your Droplet’s Public IP Address to the input box tagged Server IP Address and click save so that the IP is stored to the database.
Server IP Address
Now you’ll want to navigate to:
My Sites » Network Admin » Settings » Domains
And make make sure that the domain is mapped to the correct Site ID. Ideally, you should only enter domain.ext for the domain (i.e. without the http:// or www. prefix).
If you’re not sure what the Site ID is, you can obtain this by navigating to:
My Sites » Network Admin » Sites
… now hover the URI that is associated with the site. The link contains id=NUM where NUM is the Site ID, which is what you’ll use to map the domain to a site ID.
With these changes in place, the next item to check would be to look at your DNS Zone File. You’ll need what is commonly referred to as a “WildCard” A entry, which looks something like:
A * DROPLET_PUBLIC_IP
If that entry is missing, you’ll need to add it.
Next, you need to make sure that the domain that is being mapped points to your Droplet’s Public IP. This requires that an A entry be setup for the domain which will look like:
A @ DROPLET_PUBLIC_IP
Once all changes through ./wp-admin/ have been made, upload your newly modified wp-config.php and .htaccess files, refresh the page and log back in.
If neither of the above DNS entries are currently in place, it may take up to 24-48 hours for the DNS to fully resolve. In most cases (especially if you’re hosting your DNS with DigitalOcean), DNS will resolve almost immediately, though it depends on numerous factors, though all DNS should resolve in 24-48 hours unless there’s an issue elsewhere.
With these changes in place, you should have a working WordPress Multi-Site installation with Domain Mapping fully enabled and working.
–> Config: This is probably the relevant stuff.
// Custom Content Directory
define( 'WP_CONTENT_DIR', dirname( __FILE__ ) . '/content' );
define( 'WP_CONTENT_URL', 'http://' . $_SERVER['HTTP_HOST'] . '/content' );
define( 'ADMIN_COOKIE_PATH', 'http://www.example.com/wp-admin' );
/* Multisite */
define( 'DOMAIN_CURRENT_SITE', 'example.com' );
define( 'SUNRISE', 'on' );
–> Steps taken to setup WordPress MS: I’m unfortunately not exactly sure. A friend did it for me. To the very best of my knowledge, there was no plugin used. I have a subdomain on the site - sub.example.com - which maps to foo.com. This is enabled/visible in the Super Admin control panel under Domain Mapping.
–> DNS: I have 3 Digital Ocean nameservers listed on my domain registrar for both example.com and foo.com. I’ve added A-records + the same 3 nameservers for each of: example.com, www.example.com, sub.example.com, foo.com, and www.foo.com.
Please post your configuration , the steps taken to setup WordPress MS and any DNS changes you’ve made. That’ll help to better resolve the problem :-).
Join 1M+ other developers and: