2

Currently using the WP-mu-domain-mapping plugin on a multi-network installation. The domain mapping works fine with the provided sunrise.php file, however it breaks (sites no longer map correctly) when I move the plugin to our mu-plugins directory. I've tried the following, but it doesn't work.

<?php
$sunrises = array(
"dm_sunrise" =>  dirname( __FILE__ ) .  "/mu-plugins/domain-mapping/inc/sunrise.php"
);

foreach( $sunrises as $sunrise ){
    if( is_readable( $sunrise ) ){
        include $sunrise;
    }
}
4

As per the instructions for setting up WordPress MU Domain Mapping, sunrise.php needs to be placed directly in your /wp-content directory. It's not a plugin in the traditional sense, so can't be placed in mu-plugins (or even plugins for that matter).

Setting up this plugin can take a bit of manual work so take care to follow the instructions carefully, including the modifications you need to make to wp-config.php.

By the way, the current status of this plugin is somewhat unclear as - for new sites - it appears its functionality is now baked in to Wordpress core. It is (apparently) only now required for pre-existing Multisites which were converted some time ago. You can see various posts from the maintainer of the plugin in this support forum which confirm this.

  • Thanks for pointing this out @tim-malone. After some digging it turns out that siteurl maps the domain. Native permissions are restricted to network admins so we've tweaked it so that site owners (regular admins) can update this setting. Essentially now replacing domain mapping on our multi-network install. Thanks! – gabethegrape Jun 3 '16 at 17:18
  • Glad you solved it @gabethegrape! If you'd like, to help future visitors, you can post an additional answer with your solution, or accept this answer by clicking the check mark to the left of it. – Tim Malone Jun 4 '16 at 20:56
  • sunrise.php is required if you want to use Wordpress MU Domain Mapping plugin. That plugin throws an error in the settings page if sunrise is not present and enabled in wp-config.php. – jeffmcneill Jan 19 at 9:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.