I try to change the url of a post with rewrite rule but nothing happen, i want to change the url from this(Example):
http://mysite.local/person/jack/
To:
http://mysite.local/administration/politics/jack
I try to use rewrite rules in my functions.php file but the url not change, just redirect to the post, i want to change my url structure to view post content “jack”, here is my code:
function custom_rewrite_rule() {
add_rewrite_rule('^administration/politics/?','index.php?name=jack','top');
flush_rewrite_rules();
}
add_action('init', 'custom_rewrite_rule', 10, 0);