Answer the question
In order to leave comments, you need to log in
Why does the redirect rule fire without parameters?
Good day! We have:
1. Rule
add_action('init', function () {
foreach (['country', 'city'] as $param) add_rewrite_tag('%' .$param . '%', '([^&]+)');
add_rewrite_rule('^link/([^/]*)/([^/]*)/?', 'index.php?page_id=21&country=$matches[1]&city=$matches[2]', 'top');
}, 10, 0);
/link/a/b/
/link/
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question