if(!is_user_logged_in()) {
echo '<script>window.location.href = "/hello;</script>';
}
function custom_homepage_redirect()
{
if ( is_front_page() && is_user_logged_in() ) {
wp_redirect( home_url( '/home' ) );
die;
}
}
add_action( 'template_redirect', 'custom_homepage_redirect' );