• 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)
  • Thread Starter briandd

    (@briandd)

    (rewrite_rules gets recreated on the next page load on subsites with the correct data)

    Plugin Author xmlsitemapgenerator

    (@xmlsitemapgenerator)

    Hello.
    Would you be able to retest this please with 2.0.3.
    (assuming you are still using it?)

    Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Multisite activation breaks permalinks’ is closed to new replies.