I’m not sure but I think that you just need to add two query vars, “group” and “value”, not two rewrite tags. Can you try this:
add_filter('query_vars', 'cyb_add_query_vars');
function cyb_add_query_vars( $vars) {
$vars[] = "group"; // name of the var as seen in the query string and URL
$vars[] = "value";
return $vars;
}
add_action('init','cyb_add_rewrite_rules');
function cyb_add_rewrite_rules() {
add_rewrite_rule( '^car-videos/group/([^/]*)/value/([^/]*)/?$','index.php?page_id=40&group=$matches[1]&value=$matches[2]','top');
//Rule for pagination
add_rewrite_rule( '^car-videos/group/([^/]*)/value/([^/]*)/page/([0-9]{1,})/?$', 'index.php?page_id=40&group=$matches[1]&value=$matches[2]&paged=$matches[3]', 'top' );
}
Then this should work for pagination:
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
And you can get the values of “group” and “value” with this:
$group = get_query_var('group');
$value = get_query_var('value');
//OR
global $wp_query;
$group = $wp_query->get( 'group' );
$value = $wp_query->get('value');