Change base URL of pages created by certain users

Currently on wordpress all pages are created under the base URL (example.com/{PAGE}). Currently I am aware you can change the permalink of posts to example.com/{author}/{POST} but can this also be done for pages?

On my site I have a main user ‘admin’ using id ‘1’ and user profiles set as example.com/members/{author}

If possible I’d like all pages created by ‘admin’ to be set as example.com/{PAGE}
With pages created by other users set to example.com/members/{author}/{PAGE}

The only code i have in place in regards to permalinks is included below incase this will cause any issues.

function change_author_permalinks() {

    global $wp_rewrite;

    // Change the value of the author permalink base to whatever you want here
    $wp_rewrite->author_base = 'members';

    $wp_rewrite->flush_rules();
}

add_action('init','change_author_permalinks'); 

Solutions Collecting From Web of "Change base URL of pages created by certain users"