Buddypress Redirect User to Profile Page If Logged In user tries to reach homepage

Condition: If buddypress registration page is your homepage and if user is logged in and try to reach homepage, the current action will redirect user to member directory.

To prevent this, any filter in theme's functions.php file or bp-custom.php file won't be working.

Open

/wp-content/plugins/buddypress/bp-members/bp-members-screens.php

in bp_core_screen_signup() function

$redirect_to = bp_is_component_front_page( 'register' )
            ? bp_get_members_directory_permalink()
            : bp_get_root_domain();

Change to:

$redirect_to = bp_is_component_front_page( 'register' )
            ? $bp->loggedin_user->domain
            : bp_get_root_domain(); 

This will do the trick,

Welcoming the comments