Weekly archives are nearly undocumented, but WordPress can produce them, which I want. Good. But the URLs are ugly, eg. /?m=2020&w=18
This gets partially rewritten to /2020/?w=18
from somewhere but I'd like it if I could get the whole thing cleaned up, say as /2020/week-18
.
I can get to /week/2020/18
via:
function custom_rewrite_rule() {
add_rewrite_rule('^week/([0-9]+)/([0-9]+)/?','index.php?m=$matches[1]&w=$matches[2]','top');
}
add_action('init', 'custom_rewrite_rule', 10, 0);
…but moving the text in, ie. ^/([0-9]+)/week-([0-9]+)/?
fails and I just get 404s.
What am I doing wrong? Or is it just conflicting in some way with whatever rule is doing that partial cleanup? And if so is that addressable?
(Yes, I'm flushing the rules via admin between attempts.)