Skip to content Skip to sidebar

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

Problem:
You are experiencing issues where your .htaccess file was unexpectedly modified during a plugin update, changing the RewriteBase and RewriteRule and causing all pages to become unavailable. You suspect that the WPML plugin is responsible for these changes.
Solution:
We want to clarify that WPML does not modify your .htaccess file. The issue might be caused by third-party code, possibly from an SEO plugin or other custom code, that uses the

flush_rewrite_rules(true)

function too frequently. To identify the source, we recommend searching your codebase for occurrences of

flush_rewrite_rules

using your IDE. Meanwhile, maintaining any current workaround should help prevent further issues while you test if this resolves the problem.

Please note that this solution might be outdated or not applicable to your specific case. If the issue persists, 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 necessary, do not hesitate to open a new support ticket with us for further assistance at WPML support forum.

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 3 replies, has 0 voices.

Last updated by maximL-2 2 weeks ago.

Assisted by: Marcel.

Author Posts
March 28, 2026 at 10:03 am #17933597

maximL-2

Hi,
can you tell me please how and why it is possible that your plugin during the latest update changed my .htaccess file ?
In the website my primary language is dutch (nl), my secundary language is english (en), and for some reason your plugin decided to change the RewriteBase and RewriteRule. Causing all pages to become unavailable. I lost an hour investigating and solving it. It is clearly a bug on your side in your code to have assumed the primary language in the site is english and then automatically change the htaccess file.

It changed the default wordpress block from:

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

To

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

This should have never happened. Please investigate.

Thank you.
Best regards,
Maxim

March 30, 2026 at 10:16 am #17936084

Marcel
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: Europe/Vienna (GMT+02:00)

Hi,

please see this link with more info about why this happened: https://wpml.org/faq/why-is-htaccess-getting-overwritten-with-the-language-folder-on-my-wpml-website/.

Sometimes, third-party plugins call the flush_rewrite_rules(true) function too often. This leads to changes in the rewrite rules in your .htaccess file, which can cause issues on your WordPress site.

You can use the workaround posted there and also keep it active long-term if needed.

Best Regards,
Marcel

April 2, 2026 at 8:44 pm #17946972

maximL-2

Hi, thank you for your response.

I still don't quite understand the mechanism, but I will apply the snippet.

Also, it still does not explain why the WPML plugin would apply the secundary language instead of the first, does it? I would expect the behaviour of adding '/en/' to the htaccess file should at least be corrected by using the primary language (which is 'nl' but set as root in my case) instead of the secundary, wouldn't you agree?

Best regards,
Maxim

April 3, 2026 at 9:32 am #17947645

Marcel
Supporter

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: Europe/Vienna (GMT+02:00)

Hi Maxim,

I think there may be a misunderstanding.

WPML does not modify your .htaccess file. The issue is likely caused by third-party code that is calling the flush_rewrite_rules(true) function too frequently. This could be coming from your SEO plugin or any other custom or third-party code that uses this function.

To identify the source, you can search your codebase locally using your IDE and look for occurrences of flush_rewrite_rules.

In the meantime, the suggested workaround should prevent the issue, so it’s safe to keep it active and test whether it resolves the problem on your end.

Best regards,
Marcel

April 3, 2026 at 1:19 pm #17948001

maximL-2

Ok, thank you.

My assumption that WPML was causing it was mostly based on the fact that no other plugin knows about the extension /en/. But I read about it again, and now understand it is triggered by a visitor, visiting a english page, and a rewrite function then fires the parse_url function on that english page with extension /en/. That makes sense.

Please close the ticket.

Best regards,
Maxim