admin管理员组文章数量:1201361
I’m currently running Buddypress with Woocommerce activated (Dokan as well.)
From time to time, much more when there’s heavier traffic, there will be random 404 errors on different parts of my website. I heard it has something to do with flush rewrite rules or something.
I’m not too good at these kinds of things, I was wondering if anyone heard of something similar happening. I read that it happens when people also use LearnDash with Buddypress, and I saw a specific fix to be put in functions.php for that, I was wondering if something can be applied to my situation.
Here’s the question that’s similar:
Intermittent 404 errors, rewrite rules, and BBPress
I’m currently running Buddypress with Woocommerce activated (Dokan as well.)
From time to time, much more when there’s heavier traffic, there will be random 404 errors on different parts of my website. I heard it has something to do with flush rewrite rules or something.
I’m not too good at these kinds of things, I was wondering if anyone heard of something similar happening. I read that it happens when people also use LearnDash with Buddypress, and I saw a specific fix to be put in functions.php for that, I was wondering if something can be applied to my situation.
Here’s the question that’s similar:
Intermittent 404 errors, rewrite rules, and BBPress
Share Improve this question asked Jun 10, 2022 at 21:48 sevenkadersevenkader 112 bronze badges1 Answer
Reset to default 0To answer your question, if you are not using the LearnDash plugin then you should not add the code that is in the accepted answer of the link you have there.
That code essentially is adding a filter named learndash_flush_rewrite_rules
which appears to be specific to that plugin. If you don't have it enabled, it will most likely never run.
I took a look on some tickets and found this BP ticket which may get you started with a different solution.
One person had their issue fixed adding the following to functions.php
:
add_action('delete_option_rewrite_rules', function($option){
global $wp_rewrite;
$wp_rewrite->use_verbose_page_rules = true;
}, 10);
Definitely test that on a non-prod server before using, not sure why it worked for them, and it was 6 years ago.
Lastly, this is definitely a difficult error to troubleshoot. I'd recommend that you start debugging by logging all your 404 errors and perhaps try to recreate the bug while debugging is turned on. An idea to not disrupt production might be to have a bunch of puppeteer
scripts all going to a staging version of your site and log the errors that way.
本文标签: Random 404 errors using Buddypress
版权声明:本文标题:Random 404 errors using Buddypress 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1738547782a2096764.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论