I’ve not tried external rules, but you can achieve that with an internal rewrite and pagename
:
function wpd_page_rewrite(){
add_rewrite_rule(
'^anothername/([^/]*)/?',
'index.php?pagename=$matches[1]',
'top'
);
}
add_action( 'init', 'wpd_page_rewrite' );
For parent/child pages you have to set pagename
to the parent/child path, page/pagename
, or you can also use page_id
and use the page’s ID.
EDIT – note that you have to flush rewrite rules after adding new ones. a quick way to do this during testing is to visit the permalinks settings page.