function bp_guest_redirect() {
global $bp;
if ( !bp_is_page( om ) ) { // enter the slug or component conditional here
if(!is_user_logged_in()) { // not logged in user
wp_redirect( get_option('siteurl') . '/om' ); // user will be redirect to any link to want
}
}
}
add_filter('get_header','bp_guest_redirect',1);