• Resolved briandd

    (@briandd)


    There’s a bug in the way it is calling flush_rewrite_rules on multisite activation.

    Because flush_rewrite_rules() gets the context of the current site, it’s actually flushing the rewrites of the current site to all the subsites in a multisite install.

    You may not realize it if you have same permalinks formats on your other sites, but if you have different permalinks, this instantly results in sitewide 404 on all your other sites.

    The fix: code/core.php:

    function doSiteActivation

    replace

                    self::add_rewrite_rules();
                    flush_rewrite_rules();

    with

    if ( is_multisite() && ms_is_switched() ) {
                            delete_option( 'rewrite_rules' );
                    }
                    else {
                            self::add_rewrite_rules();
                            flush_rewrite_rules();
                    }

    This is taken from yoast ^

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Multisite activation breaks permalinks’ is closed to new replies.