if(is_user_logged_in()) {
// Redirect to another page
header("Location: http://www.example.com/logged-in-page");
} else {
// Display something else
header("Location: http://www.example.com/logged-out-page");
}
exit;
For security purposes, you have to add checks to both pages, too, or at least to the logged-in-page:
if(!is_user_logged_in()) {
header("Location: http://www.example.com/logged-out-page");
exit;
}