Skip to content Skip to sidebar

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

Problem:
You are encountering an internal server error on all pages except the homepage after editing products in the backend. The .htaccess file is automatically modified to include '/en/' as the base, which causes the error.
Solution:
This is a known issue with WPML, where the .htaccess file gets overwritten with a language folder. We recommend checking the detailed explanation and workaround provided in the WPML FAQ: Why is .htaccess getting overwritten with the language folder on my WPML website?

If this solution does not apply to your case, or if it seems outdated, please open a new support ticket. We also 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. For further assistance, you can contact us directly through our 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 2 replies, has 0 voices.

Last updated by dannyT-9 3 weeks, 3 days ago.

Assisted by: Andrey.

Author Posts
June 24, 2025 at 1:50 pm #17165333

dannyT-9

Background of the issue:
I am trying to resolve an issue where our website experiences an internal server error on all pages except the homepage after editing products in the backend. The .htaccess file is automatically modified, causing this error. Here is the problematic .htaccess configuration:

# 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.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /en/
RewriteRule ^index.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /en/index.php [L]
</IfModule>

Manually reverting the .htaccess file to the following resolves the issue:

# 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.
<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>

Symptoms:
Internal server error on all pages except the homepage after editing products in the backend. The .htaccess file is automatically modified to use /en/ as the base, causing the error.

Questions:
What triggers WPML or WordPress to rewrite the .htaccess file with /en/ as the base?
Are we possibly editing products incorrectly?
Is there a setting we need to adjust to prevent this issue?

June 24, 2025 at 2:49 pm #17165680

Andrey
WPML Supporter since 06/2013

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

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

Thank you for contacting WPML support.

You are experiencing a known issue, which is explained here:
https://wpml.org/faq/why-is-htaccess-getting-overwritten-with-the-language-folder-on-my-wpml-website/

You can add a quick workaround to resolve the issue you are facing.

June 24, 2025 at 7:41 pm #17166595

dannyT-9

Thanks for your reply, we add the quick fix to the functions.php and remove 301 redirect plugin.