I have a custom taxonomy, called filter
. All of the following urls lead to the archive.php
and should give me at least 1 post.
/filter/bar
works by default, no custom rule needed/myCategory/filter/bar
works with my own custom rule, nice!/search/foo
works by my custom rule/?s=foo&filter=bar
works as expected/search/foo/filter/bar
BOOM! No entries
Here are my rules:
add_filter("rewrite_rules_array", function($rules) {
$newRules = array();
// ... more rules
$newRules["search/(.+)/?$"] = 'index.php?s=$matches[1]';
$newRules["search/(.*)/filter/(.*)/?$"] = 'index.php?s=$matches[1]&filter=$matches[2]';
$merged = array_merge($newRules, $rules);
return $merged;
});
EDIT
Query-Monitor for the desired URL (suche = search in german)