I suggest to implement a different redirect for each unallowed page.
Something like this (NOT tested, i’m NOT a PHP skilled dev):
if ( is_user_logged_in() ) {
return;
}
// TODO admin page to manage unallowed pages and redirect to urls
$unallowed_pages = array(345, 234, 732); // pages ID
$redirect_to = array('/firstURL/', 'secondULR', 'thirdURL');
$queried = get_queried_object_id();
$found_at_index = array_search($queried, $unallowed_pages , true);
if ( !$found_at_index ) {
return;
}
wp_redirect( site_url( $redirect_to[$found_at_index] ) );
exit();
-
This reply was modified 7 years, 9 months ago by dragogio.