• Resolved dav74

    (@dav74)


    Hi there,

    We noticed with the last two WC updates, 90% of our website suddenly went down with server errors. The first time it happened we scrambled to get a backup reloaded which sorted the issue. We then transferred the site to a staging area and found out that as soon as we updated WooCommerce, our .htaccess was getting rewritten by WordPress. We checked our .htaccess and it contained:

    # BEGIN WordPress
    # Die Anweisungen (Zeilen) zwischen ?BEGIN WordPress“ und ?END WordPress“ sind
    # dynamisch generiert und sollten nur über WordPress-Filter ge?ndert werden.
    # Alle ?nderungen an den Anweisungen zwischen diesen Markierungen werden überschrieben.
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteRule .* – [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    RewriteBase /de/
    RewriteRule ^index\.php$ – [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /de/index.php [L]
    </IfModule>

    # END WordPress

    However it should have contained:

    # BEGIN WordPress
    # The directives (lines) between BEGIN WordPress and END WordPress are
    # dynamically generated, and should only be modified via WordPress filters.
    # Any changes to the directives between these markers will be overwritten.

    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ – [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]

    # END WordPress

    As soon as I updated the .htacess to the correct WP rules, then the site was straight back up and working again. I investigated this a bit further and it seems that the issue is caused by WooCommerce calling the flush_rewrite_rules(true) function too often.

    Here is a post on WPML about this: https://wpml.org/errata/htaccess-is-rewritten-with-language-folder/

    WPML says this is not an issue their end but an issue with in this case WooCommerce. Can I please ask you to look at this ASAP and provide a fix. In the meantime we hope that the code snippet that WPML provided will help as a short term solution.

    BR

Viewing 2 replies - 1 through 2 (of 2 total)
  • AJ a11n

    (@amandasjackson)

    Hi @dav74

    The post linked makes this suggestion from WPML:

    “There are many different cases depending on the plugin you are using, so if you need more help please report in our support and we’ll help you.”

    If you haven’t already, I recommend contacting their support directly, as it sounds like it could potentially be caused by another plugin on the site, not necessarily WooCommerce core.

    After working with WPML support, if you are able to determine that the issue is specific to WooCommerce core, please do submit this to the GitHub repository for WooCommerce core so the developers can take a closer look:

    https://github.com/woocommerce/woocommerce/issues/new/choose

    Thread Starter dav74

    (@dav74)

    Hello @amandasjackson

    Thanks for the reply. As I said in my original ticket, this problem was only caused when updating the WooCommerce plugin which we tested on a staging site, so yes it is the result of WooCommerce and or a conflict with WPML.

    WPML say it’s not their fault so here I am ??

    I posted the details to the Github in any case.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘WooCommerce update / WPML causing server errors’ is closed to new replies.