Php Wordpress重写规则顺序错误

Php Wordpress重写规则顺序错误,php,wordpress,rewrite,Php,Wordpress,Rewrite,使用migrate DB导出后,我的重写规则顺序不好,我无法在数据库中修复它,因为当我重新生成它们时,它会再次发生 我不知道它是否与插件有关 我称之为我的规则是与我的自定义帖子类型一起添加的规则 因此,规则应该首先从自定义帖子类型中的“我的规则”开始,但它从 .?.+?/attachment/([^/]+)/?$ => index.php?attachment=$matches[1] 这个规则和我在其他wordpress数据库中查到的遵循它的规则应该在数组的末尾 我的问题是,在这条规则之

使用migrate DB导出后,我的重写规则顺序不好,我无法在数据库中修复它,因为当我重新生成它们时,它会再次发生

我不知道它是否与插件有关

我称之为我的规则是与我的自定义帖子类型一起添加的规则

因此,规则应该首先从自定义帖子类型中的“我的规则”开始,但它从

.?.+?/attachment/([^/]+)/?$ => index.php?attachment=$matches[1]
这个规则和我在其他wordpress数据库中查到的遵循它的规则应该在数组的末尾

我的问题是,在这条规则之后,有一条规则会破坏我网站中的每一页,因为它太通用了,而且会捕获所有内容,这条规则是:

"(.?.+?)(/[0-9]+)?/?$ => index.php?pagename=$matches[1]&page=$matches[2]"
我已经调试过了,但无法解决它

这是订单:

".?.+?/attachment/([^/]+)/?$ => index.php?attachment=$matches[1]"
".?.+?/attachment/([^/]+)/trackback/?$ => index.php?attachment=$matches[1]&tb=1"
".?.+?/attachment/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$ => index.php?attachment=$matches[1]&feed=$matches[2]"
".?.+?/attachment/([^/]+)/(feed|rdf|rss|rss2|atom)/?$ => index.php?attachment=$matches[1]&feed=$matches[2]"
".?.+?/attachment/([^/]+)/comment-page-([0-9]{1,})/?$ => index.php?attachment=$matches[1]&cpage=$matches[2]"
"(.?.+?)/trackback/?$ => index.php?pagename=$matches[1]&tb=1"
"(.?.+?)/feed/(feed|rdf|rss|rss2|atom)/?$ => index.php?pagename=$matches[1]&feed=$matches[2]"
"(.?.+?)/(feed|rdf|rss|rss2|atom)/?$ => index.php?pagename=$matches[1]&feed=$matches[2]"
"(.?.+?)/page/?([0-9]{1,})/?$ => index.php?pagename=$matches[1]&paged=$matches[2]"
"(.?.+?)/comment-page-([0-9]{1,})/?$ => index.php?pagename=$matches[1]&cpage=$matches[2]"
"(.?.+?)/wc-api(/(.*))?/?$ => index.php?pagename=$matches[1]&wc-api=$matches[3]"
"(.?.+?)/order-pay(/(.*))?/?$ => index.php?pagename=$matches[1]&order-pay=$matches[3]"
"(.?.+?)/order-received(/(.*))?/?$ => index.php?pagename=$matches[1]&order-received=$matches[3]"
"(.?.+?)/view-order(/(.*))?/?$ => index.php?pagename=$matches[1]&view-order=$matches[3]"
"(.?.+?)/edit-account(/(.*))?/?$ => index.php?pagename=$matches[1]&edit-account=$matches[3]"
"(.?.+?)/edit-address(/(.*))?/?$ => index.php?pagename=$matches[1]&edit-address=$matches[3]"
"(.?.+?)/lost-password(/(.*))?/?$ => index.php?pagename=$matches[1]&lost-password=$matches[3]"
"(.?.+?)/customer-logout(/(.*))?/?$ => index.php?pagename=$matches[1]&customer-logout=$matches[3]"
"(.?.+?)/add-payment-method(/(.*))?/?$ => index.php?pagename=$matches[1]&add-payment-method=$matches[3]"
".?.+?/([^/]+)/wc-api(/(.*))?/?$ => index.php?attachment=$matches[1]&wc-api=$matches[3]"
".?.+?/attachment/([^/]+)/wc-api(/(.*))?/?$ => index.php?attachment=$matches[1]&wc-api=$matches[3]"
"(.?.+?)(/[0-9]+)?/?$ => index.php?pagename=$matches[1]&page=$matches[2]"

// my rules ...

".*wp-(atom|rdf|rss|rss2|feed|commentsrss2)\.php$ => index.php?feed=old"
".*wp-app\.php(/.*)?$ => index.php?error=403"
".*wp-register.php$ => index.php?register=true"
"feed/(feed|rdf|rss|rss2|atom)/?$ => index.php?&feed=$matches[1]"
"(feed|rdf|rss|rss2|atom)/?$ => index.php?&feed=$matches[1]"
"page/?([0-9]{1,})/?$ => index.php?&paged=$matches[1]"
"comment-page-([0-9]{1,})/?$ => index.php?&page_id=20&cpage=$matches[1]"
"wc-api(/(.*))?/?$ => index.php?&wc-api=$matches[2]"
"order-pay(/(.*))?/?$ => index.php?&order-pay=$matches[2]"
"order-received(/(.*))?/?$ => index.php?&order-received=$matches[2]"
"view-order(/(.*))?/?$ => index.php?&view-order=$matches[2]"
"edit-account(/(.*))?/?$ => index.php?&edit-account=$matches[2]"
"edit-address(/(.*))?/?$ => index.php?&edit-address=$matches[2]"
"lost-password(/(.*))?/?$ => index.php?&lost-password=$matches[2]"
"customer-logout(/(.*))?/?$ => index.php?&customer-logout=$matches[2]"
"add-payment-method(/(.*))?/?$ => index.php?&add-payment-method=$matches[2]"
"comments/feed/(feed|rdf|rss|rss2|atom)/?$ => index.php?&feed=$matches[1]&withcomments=1"
"comments/(feed|rdf|rss|rss2|atom)/?$ => index.php?&feed=$matches[1]&withcomments=1"
"comments/wc-api(/(.*))?/?$ => index.php?&wc-api=$matches[2]"
"search/(.+)/feed/(feed|rdf|rss|rss2|atom)/?$ => index.php?s=$matches[1]&feed=$matches[2]"
"search/(.+)/(feed|rdf|rss|rss2|atom)/?$ => index.php?s=$matches[1]&feed=$matches[2]"
"search/(.+)/page/?([0-9]{1,})/?$ => index.php?s=$matches[1]&paged=$matches[2]"
"search/(.+)/wc-api(/(.*))?/?$ => index.php?s=$matches[1]&wc-api=$matches[3]"
"search/(.+)/?$ => index.php?s=$matches[1]"
"author/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$ => index.php?author_name=$matches[1]&feed=$matches[2]"
"author/([^/]+)/(feed|rdf|rss|rss2|atom)/?$ => index.php?author_name=$matches[1]&feed=$matches[2]"
"author/([^/]+)/page/?([0-9]{1,})/?$ => index.php?author_name=$matches[1]&paged=$matches[2]"
"author/([^/]+)/wc-api(/(.*))?/?$ => index.php?author_name=$matches[1]&wc-api=$matches[3]"
"author/([^/]+)/?$ => index.php?author_name=$matches[1]"
"([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/feed/(feed|rdf|rss|rss2|atom)/?$ => index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&feed=$matches[4]"
"([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/(feed|rdf|rss|rss2|atom)/?$ => index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&feed=$matches[4]"
"([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/page/?([0-9]{1,})/?$ => index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&paged=$matches[4]"
"([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/wc-api(/(.*))?/?$ => index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]&wc-api=$matches[5]"
"([0-9]{4})/([0-9]{1,2})/([0-9]{1,2})/?$ => index.php?year=$matches[1]&monthnum=$matches[2]&day=$matches[3]"
"([0-9]{4})/([0-9]{1,2})/feed/(feed|rdf|rss|rss2|atom)/?$ => index.php?year=$matches[1]&monthnum=$matches[2]&feed=$matches[3]"
"([0-9]{4})/([0-9]{1,2})/(feed|rdf|rss|rss2|atom)/?$ => index.php?year=$matches[1]&monthnum=$matches[2]&feed=$matches[3]"
"([0-9]{4})/([0-9]{1,2})/page/?([0-9]{1,})/?$ => index.php?year=$matches[1]&monthnum=$matches[2]&paged=$matches[3]"
"([0-9]{4})/([0-9]{1,2})/wc-api(/(.*))?/?$ => index.php?year=$matches[1]&monthnum=$matches[2]&wc-api=$matches[4]"
"([0-9]{4})/([0-9]{1,2})/?$ => index.php?year=$matches[1]&monthnum=$matches[2]"
"([0-9]{4})/feed/(feed|rdf|rss|rss2|atom)/?$ => index.php?year=$matches[1]&feed=$matches[2]"
"([0-9]{4})/(feed|rdf|rss|rss2|atom)/?$ => index.php?year=$matches[1]&feed=$matches[2]"
"([0-9]{4})/page/?([0-9]{1,})/?$ => index.php?year=$matches[1]&paged=$matches[2]"
"([0-9]{4})/wc-api(/(.*))?/?$ => index.php?year=$matches[1]&wc-api=$matches[3]"
"([0-9]{4})/?$ => index.php?year=$matches[1]"
"[^/]+/attachment/([^/]+)/?$ => index.php?attachment=$matches[1]"
"[^/]+/attachment/([^/]+)/trackback/?$ => index.php?attachment=$matches[1]&tb=1"
"[^/]+/attachment/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$ => index.php?attachment=$matches[1]&feed=$matches[2]"
"[^/]+/attachment/([^/]+)/(feed|rdf|rss|rss2|atom)/?$ => index.php?attachment=$matches[1]&feed=$matches[2]"
"[^/]+/attachment/([^/]+)/comment-page-([0-9]{1,})/?$ => index.php?attachment=$matches[1]&cpage=$matches[2]"
"([^/]+)/trackback/?$ => index.php?name=$matches[1]&tb=1"
"([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$ => index.php?name=$matches[1]&feed=$matches[2]"
"([^/]+)/(feed|rdf|rss|rss2|atom)/?$ => index.php?name=$matches[1]&feed=$matches[2]"
"([^/]+)/page/?([0-9]{1,})/?$ => index.php?name=$matches[1]&paged=$matches[2]"
"([^/]+)/comment-page-([0-9]{1,})/?$ => index.php?name=$matches[1]&cpage=$matches[2]"
"([^/]+)/wc-api(/(.*))?/?$ => index.php?name=$matches[1]&wc-api=$matches[3]"
"[^/]+/([^/]+)/wc-api(/(.*))?/?$ => index.php?attachment=$matches[1]&wc-api=$matches[3]"
"[^/]+/attachment/([^/]+)/wc-api(/(.*))?/?$ => index.php?attachment=$matches[1]&wc-api=$matches[3]"
"([^/]+)(/[0-9]+)?/?$ => index.php?name=$matches[1]&page=$matches[2]"
"[^/]+/([^/]+)/?$ => index.php?attachment=$matches[1]"
"[^/]+/([^/]+)/trackback/?$ => index.php?attachment=$matches[1]&tb=1"
"[^/]+/([^/]+)/feed/(feed|rdf|rss|rss2|atom)/?$ => index.php?attachment=$matches[1]&feed=$matches[2]"
"[^/]+/([^/]+)/(feed|rdf|rss|rss2|atom)/?$ => index.php?attachment=$matches[1]&feed=$matches[2]"
"[^/]+/([^/]+)/comment-page-([0-9]{1,})/?$ => index.php?attachment=$matches[1]&cpage=$matches[2]"
我用一些阵列拼接暂时修复了这个问题,但我相信这个修复可能会在将来中断

我想知道为什么这一代人错了


非常感谢

您如何添加规则?具有如果是,第三个参数是什么?嗨,我自己不操纵规则。我所说的规则是我添加的自定义帖子类型中的规则。Thanks@resehuvija假设你最终解决了这个问题,你是怎么解决的?