Skip to content Skip to sidebar

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

Problem:
When WPML is enabled and a visitor switches language to /en/, WordPress rewrites .htaccess with:

RewriteBase /en/

and routes requests to /en/index.php. There is no physical /en/ directory as language URLs are virtual. This causes REST API endpoints (/wp-json/, /wp-json/wp/v2/) to break and results in intermittent server-level 404 errors. Disabling WPML stops this behavior, and locking .htaccess prevents the rewrite but is only a workaround.

Solution:
This issue is likely related to a known problem where .htaccess gets overwritten with the language folder. We recommend you ensure to have a full website backup and apply the solution outlined in the erratum. You can find more details and guidance here: Why is .htaccess getting overwritten with the language folder on my WPML website?

If this solution does not resolve your issue or seems outdated, 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 problem persists, please open a new support ticket 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.

Tagged: 

This topic contains 2 replies, has 0 voices.

Last updated by Maria Papaefstathiou 4 days, 14 hours ago.

Assisted by: Lucas Vidal de Andrade.

Author Posts
February 11, 2026 at 1:28 pm #17812874

Maria Papaefstathiou

Thank you! This resolved the issue.

I am sending you the message below for the Rewrite base issue / 404 server-level effect to open a new ticket.

WPML REWRITE BASE / 404 ISSUE (SERVER-LEVEL EFFECT)
────────────────────────

Problem:
- When WPML is enabled and a visitor switches language to /en/,
WordPress rewrites .htaccess with:
RewriteBase /en/
and routes requests to /en/index.php
- There is NO physical /en/ directory (language URLs are virtual).
- This causes REST API endpoints (/wp-json/, /wp-json/wp/v2/) to break
and results in intermittent server-level 404 errors.

Observations:
- Disabling WPML immediately stops this behaviour.
- Locking .htaccess (permissions 444) prevents the rewrite and stabilizes the site,
but this is only a workaround, not a proper fix. (For now, I kept it locked so the website can run)

We need:
- Confirmation whether this is a known WPML issue with
“Different languages in directories”
- Proper guidance on preventing RewriteBase from being rewritten to /en/
while keeping directory-based language URLs.

February 11, 2026 at 1:30 pm #17812875

Lucas Vidal de Andrade
WPML Supporter since 11/2023

Languages: English (English ) Spanish (Español ) German (Deutsch ) Portuguese (Brazil) (Português )

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

Hello,

Thank you for sharing. This is very likely the known issue below:
https://wpml.org/faq/why-is-htaccess-getting-overwritten-with-the-language-folder-on-my-wpml-website/

Please ensure to have a full website backup, and apply the solution outlined in the erratum. Let me know how it goes.

February 14, 2026 at 7:51 am #17822261

Maria Papaefstathiou

Hi there,
The link you sent me was helpful and resolved my issue.
Thank you!