That depends on what condition you choose, let's assume that it is a session variable named isLoggdIn for simplicity.
if (isset($_SESSION['isLoggedIn']) && $_SESSION['isLoggedIn'] == true)
echo '<script>window.location = "http://www.yoururl.com/page_A.php";</script>';
else
echo '<script>window.location = "http://www.yoururl.com/page_B.php";</script>';
Remember to do this check on all your restricted pages so that people can't access the logged in section without being logged in.