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
版权声明:本文标题:Rewrite rule leads to 404 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736285950a1927564.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论