Skip to content Skip to sidebar

This thread is resolved. Here is a description of the problem and solution.

Problem:
You are experiencing an Error 500 on your server due to too many redirects after updating WooCommerce. This issue is linked to a corrupted .htaccess file caused by WPML leaving a redirect in it to secondary languages.
Solution:
If you're facing this issue, we recommend checking if third-party plugins are calling the

flush_rewrite_rules(true)

function too frequently, which can repeatedly modify the rewrite rules in your .htaccess file. This frequent modification might be causing the issues on your WordPress site. For more information and a suggested workaround, please visit our FAQ: Why is .htaccess getting overwritten with the language folder on my WPML website?

Please note that this solution might be outdated or not applicable to your specific case. We highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the issue persists, please open a new support ticket for further assistance.

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 6 replies, has 1 voice.

Last updated by Andrey 1 month, 1 week ago.

Assisted by: Andrey.

Author Posts
June 20, 2025 at 8:04 am #17153060

mirteM

Background of the issue:
I was trying to resolve an error 500 on my server caused by too many redirects after updating WooCommerce. I found a similar issue documented here: https://wpml.org/errata/woocommerce-multilingual-too-many-redirects-error-when-using-shop-base-with-category-permalinks/comment-page-1/?unapproved=9535274&moderation-hash=8ca0a5717fc14ee8a50a1a9f5f4aeef0. My issue is related to a custom base 'products'. I discovered that the .htaccess file was corrupted due to WPML leaving a redirect in it to secondary languages. I fixed it by saving permalinks again.

Symptoms:
Error 500 on the server due to too many redirects. The .htaccess file was corrupted.

Questions:
How can I prevent the .htaccess file from being corrupted after a WooCommerce update?
Is there a permanent fix for the redirect issue caused by WPML?

June 20, 2025 at 8:08 am #17153126

mirteM

at the same time of this error I also have this one in the logs:

[17-Jun-2025 12:37:19 UTC] PHP Fatal error:  Uncaught Error: Class "WC_Notes_Refund_Returns" not found in /data/sites/web/baniwafelsbe/www/wp-content/plugins/woocommerce/src/Internal/Admin/Events.php:129
Stack trace:
#0 /data/sites/web/baniwafelsbe/www/wp-content/plugins/woocommerce/src/Internal/Admin/FeaturePlugin.php(160): Automattic\WooCommerce\Internal\Admin\Events->init()
#1 /data/sites/web/baniwafelsbe/www/wp-content/plugins/woocommerce/src/Internal/Admin/FeaturePlugin.php(109): Automattic\WooCommerce\Internal\Admin\FeaturePlugin->includes()
#2 /data/sites/web/baniwafelsbe/www/wp-content/plugins/woocommerce/src/Internal/Admin/FeaturePlugin.php(92): Automattic\WooCommerce\Internal\Admin\FeaturePlugin->on_plugins_loaded()
#3 /data/sites/web/baniwafelsbe/www/wp-content/plugins/woocommerce/src/Admin/Composer/Package.php(65): Automattic\WooCommerce\Internal\Admin\FeaturePlugin->init()
#4 [internal function]: Automattic\WooCommerce\Admin\Composer\Package::init()
#5 /data/sites/web/baniwafelsbe/www/wp-content/plugins/woocommerce/src/Packages.php(291): call_user_func(Array)
#6 /data/sites/web/baniwafelsbe/www/wp-content/plugins/woocommerce/src/Packages.php(89): Automattic\WooCommerce\Packages::initialize_packages()
#7 /data/sites/web/baniwafelsbe/www/wp-includes/class-wp-hook.php(324): Automattic\WooCommerce\Packages::on_init('')
#8 /data/sites/web/baniwafelsbe/www/wp-includes/class-wp-hook.php(348): WP_Hook->apply_filters(NULL, Array)
#9 /data/sites/web/baniwafelsbe/www/wp-includes/plugin.php(517): WP_Hook->do_action(Array)
#10 /data/sites/web/baniwafelsbe/www/wp-settings.php(578): do_action('...')
#11 /data/sites/web/baniwafelsbe/www/wp-config.php(100): require_once('...')
#12 /data/sites/web/baniwafelsbe/www/wp-load.php(50): require_once('...')
#13 /data/sites/web/baniwafelsbe/www/wp-blog-header.php(13): require_once('...')
#14 /data/sites/web/baniwafelsbe/www/index.php(17): require('...')
#15 {main}
  thrown in /data/sites/web/baniwafelsbe/www/wp-content/plugins/woocommerce/src/Internal/Admin/Events.php on line 129
[17-Jun-2025 12:37:19 UTC] PHP Fatal error:  Uncaught Error: Class "WC_Admin_Settings" not found in /data/sites/web/baniwafelsbe/www/wp-content/plugins/woocommerce/src/Internal/Admin/Logging/Settings.php:449
Stack trace:
#0 /data/sites/web/baniwafelsbe/www/wp-content/plugins/woocommerce/src/Utilities/LoggingUtil.php(28): Automattic\WooCommerce\Internal\Admin\Logging\Settings->logging_is_enabled()
#1 /data/sites/web/baniwafelsbe/www/wp-content/plugins/woocommerce/includes/class-wc-logger.php(116): Automattic\WooCommerce\Utilities\LoggingUtil::logging_is_enabled()
#2 /data/sites/web/baniwafelsbe/www/wp-content/plugins/woocommerce/includes/class-wc-logger.php(173): WC_Logger->should_handle('...')
#3 /data/sites/web/baniwafelsbe/www/wp-content/plugins/woocommerce/includes/class-wc-logger.php(236): WC_Logger->log('...', '...', Array)
#4 /data/sites/web/baniwafelsbe/www/wp-content/plugins/woocommerce/includes/class-woocommerce.php(421): WC_Logger->critical('...', Array)
#5 [internal function]: WooCommerce->log_errors()
#6 {main}
  thrown in /data/sites/web/baniwafelsbe/www/wp-content/plugins/woocommerce/src/Internal/Admin/Logging/Settings.php on line 449

This is the redirect limits causing website to be unreachable:

[Tue Jun 17 14:41:28.383137 2025] [error] [pid 715931] core.c(4073): [client 156.200.109.186:0] AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.
[Tue Jun 17 14:41:30.673524 2025] [error] [pid 715996] core.c(4073): [client 2a02:2788:9d9:f4a0:b846:4050:e5d5:7e30:0] AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace.

Perhaps that is useful for the troubleshooting.

This is the part of the htaccess that causes the redirects (notice the fr):

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /fr/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /fr/index.php [L]
</IfModule>
# END WordPress

This is what the htaccess should be:

# END WP Rocket
# BEGIN WordPress
# De richtlijnen (regels) tussen "BEGIN WordPress" en "END WordPress" worden
# dynamisch gegenereerd en zouden alleen aangepast mogen worden via WordPress filters.
# Alle wijzigingen aan de richtlijnen tussen deze markeringen worden overschreven.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

June 21, 2025 at 12:25 pm #17155988

Andrey
WPML Supporter since 06/2013

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+03:00)

Thank you for contacting WPML support.

Sometimes, third-party plugins call the flush_rewrite_rules(true) function too frequently. This can repeatedly modify the rewrite rules in your .htaccess file, which may cause issues on your WordPress site.

Please check this article for more information and a suggested workaround:

https://wpml.org/faq/why-is-htaccess-getting-overwritten-with-the-language-folder-on-my-wpml-website/

June 21, 2025 at 2:29 pm #17156142

mirteM

Hey Andrey,

Thank you for the info. I will keep it in mind. However my issue is more related to the original bug report (open issue link in initial post). It is exactly the same thing.

June 21, 2025 at 4:43 pm #17156243

Andrey
WPML Supporter since 06/2013

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+03:00)

Thank you for your feedback.

You originally reported the following:

I was trying to resolve an error 500 on my server caused by too many redirects after updating WooCommerce. I found a similar issue documented here: https://wpml.org/errata/woocommerce-multilingual-too-many-redirects-error-when-using-shop-base-with-category-permalinks/comment-page-1/?unapproved=9535274&moderation-hash=8ca0a5717fc14ee8a50a1a9f5f4aeef0. My issue is related to a custom base 'products'. I discovered that the .htaccess file was corrupted due to WPML leaving a redirect in it to secondary languages. I fixed it by saving permalinks again.

Have you tried to apply both workarounds from this link and the one I mentioned in my previous post?

June 23, 2025 at 11:42 am #17159916

mirteM

Hey Andrey,

For the time being the issue is resolved as I resaved the permalinks. I mostly wanted to report so when they fix the linked bug the also take into account products with custom base.

June 23, 2025 at 11:45 am #17159931

Andrey
WPML Supporter since 06/2013

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+03:00)

Thank you for letting us know. I hope the workaround will also help prevent .htaccess from being rewritten. Have a nice week.