Support » Plugin: No Category Base (WPML) » Not bad, but return 404.

  • Return 404 from old url (with “category”). 404 is not bad for new sites, but for old it must be 301. Multisite.

    May be need to do somthing like this:

    $blog_id = get_current_blog_id();
    if ( is_multisite() && $blog_id == 1 ) {
    $sitename = '/blog/';
    }
    elseif ( is_multisite() && $blog_id !== 1 ) {
    $sitename = get_blog_details( $blogId )->path;
    }
    else {
    $sitename = '/';
    }
    return $sitename;

    And then change “/” before “category” to “$sitename” in all urls.

    • This topic was modified 1 year, 7 months ago by akkoxe.
  • The topic ‘Not bad, but return 404.’ is closed to new replies.