Extending page urls without getting a 404

This code fixes the problem:

function gender_endpoints() {
    add_rewrite_endpoint('female', EP_PAGES);
    add_rewrite_endpoint('male', EP_PAGES);
}

add_action('init', 'gender_endpoints');