you can follow these steps..
For add rewrite rules:
add_action('init', function () { add_rewrite_tag('%country%', '([^&]+)', 'country='); add_rewrite_rule('^directors/([^/]+)/?$', 'index.php?pagename=directors&country=$matches[1]', 'top'); });
To prevent redirects:
add_filter('redirect_canonical', function ($redirect_url, $requested_url) { return (strpos($requested_url, '/directors/') !== false) ? false : $redirect_url; }, 10, 2);
for whitelist query variable:
add_filter('query_vars', function ($vars) { $vars[] = 'country'; return $vars; });
then just save your permalinks again .. then clear your website caching if you are using the caching plugin.
Let me know after apply them.