How to embed a new string in url?

try this

add_filter( 'rewrite_rules_array','my_insert_rewrite_rules' );
add_filter( 'query_vars','my_insert_query_vars' );
function my_insert_rewrite_rules( $rules )

{
    $newrules = array();
    $newrules['(.+?)/custom_post_type_slug/(.+?)/?$'] = 'index.php?post_type=custom_post_type_slug&dynamic_string=$matches[1]&custom_post_type_slug=$matches[2]';
    return $newrules + $rules;
}

function my_insert_query_vars( $vars )
{
    array_push($vars, 'dynamic_string');
    return $vars;
}