Requested URL changes when using custom rewrite rule

this:

add_rewrite_rule(
    'membership/member-profile/([^/]+)/?$',
    'index.php?pagename=member-profile&profile=$matches[1]',
    'top' );

should be:

add_rewrite_rule(
    'membership/member-profile/([^/]+)/?$',
    'index.php?pagename=membership/member-profile&profile=$matches[1]',
    'top' );

the difference is pagename should contain the parent/child path.

also- if profile isn’t a recognized query var, it needs to be added in order to be accessed:

function wpse47596_query_vars( $query_vars ){
    $query_vars[] = 'profile';
    return $query_vars;
}
add_filter( 'query_vars', 'wpse47596_query_vars' );

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)