WooCommerce update / WPML causing server errors
-
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) betweenBEGIN WordPress
andEND 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
- The topic ‘WooCommerce update / WPML causing server errors’ is closed to new replies.