• On a client site with lots of plugin, WC rewrites the htaccess file every time someone load a page, frontend or backend no matters.

    Even if I just go to the dashboard, htaccess is wrote again.

    What could make this happen?
    I guess WC is asking everytime for a reflush of the rewrite rules? How can I stop that?

    I disabled every other plugin, even switched theme, updated WC lots of times, < 2.3.8 do that, 2.3.8 do that, 2.3.9 keep doing that.

    I have other sites with WC installed and this is not happening.

    https://www.ads-software.com/plugins/woocommerce/

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hi Tony,

    I have exactly the same problem that you describe and I can’t find a solution.

    Did you find the solution?

    Thanks in advance,
    Trici

    Plugin Contributor Mike Jolley

    (@mikejolley)

    Flushing is only performed on activation, and on viewing the welcome screen. Maybe another plugin – possible one which relies on WC if the issue stops when WC is turned off.

    Hi, i got a quite similar issue, that is everytime i change a setting in woocommerce setting panel, my htaccess is rewritten/flushed.

    Can anyone help?

    Thank you.

    Plugin Contributor Mike Jolley

    (@mikejolley)

    Thats normal; to ensure the permalink settings are reflected in WP’s rewrite rules.

    Thread Starter Toni X

    (@toni-x)

    I found out the problem. WC has 2 variables stored in the database, a WC version and a WC DB version. For some reason, on my client site, WC DB version was stuck at 2.2.8 (if I remember correctly) even if WC was updated several times to every last version.

    WC checks WC & DB versions at the beginning to understand if you are updating WC. The code in WC_Install doesn’t handle properly such strange case.

    The misalignment between the 2 variables created a kind of loop in the starting sequence of WC that made it silently (and partially) run the WC install code every time.

    The wc db version was never updated so this code in WC_Install::install was executed again and again and made it flush the rewrite rules on every page load.

    // Flush rules after install
    flush_rewrite_rules();

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘WooCommerce rewrite .htaccess on every page load’ is closed to new replies.