admin管理员组

文章数量:1122846

I have some custom rewrite rules for my WordPress page. Most of them work as expected, but one does not. And I do not find any solution therefore.

What does work for example:

add_rewrite_rule(
    '^veranstaltungen/kategorie/([^/]+)/feed/?$',
    'index.php?post_type=tribe_events&tribe_events_cat=$matches[1]&feed=rss2',
    'top'
);

add_rewrite_rule(
    '(?:alle\-veranstaltungen)/(?:tag|schlagwort)/([^/]+)/feed/?$',
    'index.php?post_type=tribe_events&tag=$matches[1]&eventDisplay=list&feed=rss2',
    'top'
);

add_rewrite_rule(
    '^veranstaltungen/(?:tag|schlagwort)/?$',
    'index.php?post_type=tribe_events&$matches[1]=$matches[2]',
    'top'
);

What does not:

add_rewrite_rule(
    '^veranstaltungen/(?:tag|schlagwort)/([^/]+)/feed/?$',
    'index.php?post_type=tribe_events&tag=$matches[1]&eventDisplay=list&feed=rss2',
    'top'
);

I do not find anything that avoids the last rule to work properly.

I have checked the rewrite rule inspector and it shows this last rule as it is defined. So it should be registered correctly. And there seems to be no other rule for that URLs that overwrites it.

And when I open index.php?post_type=tribe_events&tag=XYZ&eventDisplay=list&feed=rss2 directly, it shows the right RSS feed. So it seems to be correct as well.

Do you have any idea, why this last rule won't work?

本文标签: Rewrite rule leads to 404