Intermittent 404 and rewrite rules issue
-
I am trying to debug an intermittent 404 issue that has been traced to BBPress. I’ve read several other reports about intermittent 404s and BBPress, but none of them are quite applicable to my situation, so I’m creating a new support topic.
The main page of my website will intermittently load with a 404.The intermittent access issue appears to last between 10 seconds and 3 minutes at a time. When this happens, it’s down for everyone trying to access the site (confirmed while on the phone with hosting service tech support). Other pages on the site appear to load correctly during this time window. Hitting refresh will eventually successfully reload the page correctly.
I am using Query Monitor to examine the rewrite rules. Here are the results when the page is loading incorrectly:
Request account-2/conscious-business-design-dashboard Matched Rule [^/]+/([^/]+)/?$ Matched Query attachment=conscious-business-design-dashboard Query String attachment=conscious-business-design-dashboard Query Vars attachment conscious-business-design-dashboard comments_per_page 50 name conscious-business-design-dashboard order DESC posts_per_page 10 update_post_meta_cache 1 update_post_term_cache 1
Here are the results when the page is loading correctly:
Request account-2/conscious-business-design-dashboard Matched Rule (.?.+?)(?:/([0-9]+))?/?$ Matched Query pagename=account-2%2Fconscious-business-design-dashboard &page= Query String pagename=account-2%2Fconscious-business-design-dashboard Query Vars comments_per_page 50 name conscious-business-design-dashboard order DESC pagename conscious-business-design-dashboard posts_per_page 10 update_post_meta_cache 1 update_post_term_cache 1 Queried Object Single Page: #225 (WP_Post)
Here is the most relevant query that is being run during the 404:
SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND wp_posts.post_name = 'conscious-business-design-dashboard' AND wp_posts.post_type = 'attachment' ORDER BY wp_posts.post_date DESC
Here is the query run when the page successfully loads:
SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND (wp_posts.ID = '225') AND wp_posts.post_type = 'page' ORDER BY wp_posts.post_date DESC
When I look at the BBPress code, I can identify the rewrite rules here:
// Rewrite rule matches used repeatedly below $root_rule = '/([^/]+)/?$'; $feed_rule = '/([^/]+)/' . $feed_slug . '/?$'; $edit_rule = '/([^/]+)/' . $edit_slug . '/?$'; $paged_rule = '/([^/]+)/' . $paged_slug . '/?([0-9]{1,})/?$';
However, all slugs are correctly set in the database, and I can’t figure out how they might be getting corrupted.
Any suggestions for further troubleshooting?
- You must be logged in to reply to this topic.