I have a multisite install of WordPress. I have installed the plugin Monkeyman Rewrite Analyzer so I can see all the rules I have registered. The code below is how I am registering the rule:
add_action( 'init', 'add_init_rules' );
function add_init_rules() {
add_rewrite_rule('^car/([^/]*)/([^/]*)/?','index.php?pagename=car&id=$matches[1]&make=$matches[2]','top');
}
The rule I have added does not appear in the Monkeyman Rewrite Analyzer list and does not appear to make any difference to the site when trying to visit mysite.com/32423/testmake
Any suggestions?
2 Answers
Did you flush the rules after making this code?
Visit the Settings->Permalinks screen. This will cause a rule flush. Then check and see if your new rule appears.