add_action( 'template_redirect', '_redirect_to_post' );
function _redirect_to_post(){
if ( is_page( 'resources' ) && is_user_logged_in() ) {
wp_redirect( home_url( '/resources/all' ) );
die;
}
if(is_page( 'resources/all' ) && !is_user_logged_in()) {
wp_redirect( home_url( '/resources' ) );
die;
}
}