admin管理员组文章数量:1276729
I have a parent/child and another parent/child/child pages. I have 2 separate page templates for both pages and the following add_rewrite_rule() code in place:
add_rewrite_rule( '^user/dashboard/([^/]*)/?’, 'index.php?pagename=user/dashboard&profile=$matches[1]', 'top' );
add_rewrite_rule( '^user/dashboard/billing/([^/]*)/?’, 'index.php?pagename='user/dashboard/billing&profile=$matches[1]', 'top' );
The first one (i.e. parent/child) works fine but the 2nd one (i.e parent/child/child) is not working. Meaning when I go to the parent/child/child page, it is using the template of the parent/child page and not the one assigned to itself.
If I comment out the first add_rewrite_rule() line, it works as expected. Seems like the first one is overriding the 2nd one.
I have tried flushing the rewrite rules manually by going to settings > permalinks.
I have even tried to change the order of the rewriting rules i.e. I tried registering the parent/child/child path before parent/child rule and then flushed the rules manually. But that also didn't help.
Any help is appreciated.
本文标签: url rewritingaddrewriterule() issue with parentchildchild page
版权声明:本文标题:url rewriting - add_rewrite_rule() issue with parentchildchild page 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1741279927a2369948.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论