BuddyDev

Search

Buddypress 404 member issue

  • Participant
    Level: Guru
    Posts: 885
    Tosin on #35323

    Hello

    I just started using this plugin https://wp301redirects.com/

    Plugin works fine but detects all buddypress members as 404 and redirects them to 404 error page.

    Does buddpress members profile page have anything or function that could trigger 404 errors? quite strange

    Thanks

  • Participant
    Level: Guru
    Posts: 885
    Tosin on #35324
    This reply has been marked as private.
  • Keymaster
    Level: Yogi
    (BuddyDev Team)
    Posts: 2934
    Ravi on #35329

    Hello Tosin,

    Thank you for posting. I have tested it with default WordPress theme and BuddyPress7.1.0 and it is working for me. Please share your plugin configurations so that I can check it.

    Reagrds
    Ravi

    • This reply was modified 3 years, 3 months ago by Ravi.
  • Participant
    Level: Guru
    Posts: 885
    Tosin on #35331

    Hello Ravi

    I was digging through wordpress directory and I found this plugin which fixed the issue https://wordpress.org/plugins/bp-404s/ The plugin author gave some explanations in plugin description

    My question now is why does buddypress generate 404 errors in the first place when ROOT PROFILE is enabled in bp-custom.php.

    Thanks

  • Participant
    Level: Guru
    Posts: 885
    Tosin on #35332

    This is the code in the plugin can this code be added to bp-custom.php file

     if (!defined('ABSPATH'))
    {
    	exit;
    }
    
    function tomas_bp_no_404()
    {
    global $wp_query;
    
     if (!(empty(bp_current_component())))
     {
     	$wp_query->is_404 = false;
     }
    
    }
    add_action( 'template_redirect', 'tomas_bp_no_404' ,1); 
  • Keymaster
    (BuddyDev Team)
    Posts: 24190
    Brajesh Singh on #35352

    Hi Tosin,
    Yes, you can disable the plugin and put that code in bp-custom.php

    You may also simlify the above code

    
    function tomas_bp_no_404() {
    	global $wp_query;
    
    	if ( bp_current_component() ) {
    		$wp_query->is_404 = false;
    	}
    
    }
    
    add_action( 'template_redirect', 'tomas_bp_no_404', 1 );
    

    Regards
    Brajesh

    PS:- I haven’t seen this issue with BuddyPress. If you can post the steps to reproduce it, I will suggest opening a ticket on BuddyPress trac.

You must be logged in to reply to this topic.

This topic is: not resolved