• I realise this is a returning issue but up until now I can not find a satisfying solution.

    The problem:
    Some of our category pages regularly return a 404 which can be solved by re-saving Permalinks. In our case this happens several times per week.

    Additional info:
    The affected category pages are build with the DIVI Theme Building and linked to Post Categories.

    Unsatisfying solutions:

    • Resaving Permalinks: This is what I do now but after the pages have gone offline which is too late, obviously.
    • Turn off all plugins and themes and turn them back on to find which plugin or theme is causing it: I don’t know how this “solution” is suggested so often but on a live site this is impossible to do. I tried recreating the issue on our test site but I was unable to do so. I don’t know the cause and, apparently, the site needs visitors and/or administrators for the issue to happen.
    • Save .htaccess files when the issue occurs and compare it with the .htaccess file while there is no issue. In our case these are exactly the same.
    • Running a cron job to resave permalinks every hour (or so). This is what I will do when I can’t find a durable/permanent solution but this is simptom treatment, hence not ideal either.

    Some plugins we use that might influence the affected pages

    • Yoast SEO
    • WP Rocket
    • WPML
    • DIVI page builder

    Does anyone have any ideas (apart from the once listed above) on how to find the cause and maybe solve this?

    Thanks!

    • This topic was modified 3 years, 11 months ago by Kim.
    • This topic was modified 3 years, 11 months ago by Kim.
Viewing 4 replies - 1 through 4 (of 4 total)
  • try going to Settings->parmalinks and press the save button. This could of been caused by a plugin. But, sometimes when changes are made to things like custom post types or to your taxonomy it will cause a problem with the parmalink.

    Hi, I had a big problem with another multilingual plugin, so, possibly it can be the cause. I prevented the system from resaving .htaccess (it was initiated by WooCommerce) by ‘flush_rewrite_rules_hard’ filter and also found out what is going on wrong with rewrite rules and changed them with ‘rewrite_rules_array’ filter.

    You can also try to add rewrite rules flush to some key point, after saving post/category etc. It’s better to find out the exact point in which this problem is occurring, it supposes to be such an event like saving something.

    Thread Starter Kim

    (@spacewell)

    Thanks for your replies.

    I have compared .htaccess files and it seems that when the pages return 404 the .htaccess file is exactly the same as when the pages work correctly. So I am assuming it is not the .htaccess file.

    The permalinks need resaving when anything changes to the categories but I think this is normal behaviour. In our case it seems the issue occurs even when no one is working in the backend. However, we have over ten people working on content who all have limited access. If they say they did not change anything I have no choice than beleving them.

    I agree I need to find the cause. I am working on a tool that will send me an sms whenever one of these pages go offline. This will narrow down the time when this actually happens.

    You can set up a simple script to check some URL by curl with cron and send you an email with the exact time when it found out the wrong answer. Also, you can check ‘auto-draft’s timing on ‘wp_posts’ table (you can have another table_prefix rather then ‘wp_’).

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘Category pages regularly return 404, permalinks need constant resaving’ is closed to new replies.