Fixed rewrite issue with multisite

Applied a fix for the rewrite issues regarding Multisite WP setups.