Skip to content Skip to sidebar

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

Problem:
The client is experiencing an infinite redirection loop when visiting the English version of their site with the WPML SEO plugin activated. This issue arises after changing their setup to have each language in its own directory, with an HTML page at the root URL that redirects based on browser language.

Solution:
1) Ensure you are following the steps in our documentation to set up the Language Directory for the default language:
Redirect the root domain to the default language
Language setup for directory default language
2) Upgrade to the latest version of WPML plugins (4.8.1 series).
3) Go to WPML >> Languages >> Languages URL format, and resave the settings.
4) Visit Settings >> Permalinks, and resave the settings.
5) Clear all types of caches.
6) Check for unexpected redirects set inside the "Redirection" plugin or other SEO plugins like Yoast SEO Premium, as these might conflict with WPML's settings.

If these steps do not resolve the issue, it might be due to specific configurations or conflicts within your site. We 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.

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

Last updated by fredericG-12 4 days, 9 hours ago.

Assisted by: Andreas W..

Author Posts
September 12, 2025 at 1:37 pm #17397723

fredericG-12

Background of the issue:
I am trying to set up a WPML configuration where each language has its own directory. We have moved from a setup where each language had its own domain to the following setup: Default Language to own directory and using an HTML page for the root URL. The languages and mapping directories are: hidden link (default language), hidden link, hidden link. Additionally, we have a hidden link file that redirects based on the browser language. The issue occurs when the WPML SEO plugin is active.

Symptoms:
When the WPML SEO plugin is active, visiting the English site at hidden link causes an infinite redirection loop. The user is redirected to hidden link, which calls the redirect.html file, redirecting the user back to hidden link, and so on. Deactivating the WPML SEO plugin resolves the issue.

Screencast: hidden link

Questions:
How can I resolve the infinite redirection loop caused by the WPML SEO plugin?
Is there a way to use both WPML and WPML SEO without encountering this issue?

September 12, 2025 at 3:05 pm #17398251

Bigul

Hello,

Welcome to the WPML support forum. I will do my best to assist you in resolving the issue.

I hope you are following the steps outlined in this documentation to set up the Language Directory for the default language:

https://wpml.org/documentation/getting-started-guide/language-setup/directory-default-language/#redirect-the-root-domain-to-the-default-language

https://wpml.org/documentation/getting-started-guide/language-setup/directory-default-language/

If the issue persists, please try these steps after creating a full site backup, and then check if the problem still exists:

1) Upgrade to the latest version of WPML plugins (4.8.1 series)
2) Go to WPML >> Languages >> Languages URL format, and resave the settings
3) Visit Settings >> Permalinks, and resave the settings
4) Clear all types of caches

--
Thanks!

Bigul

September 12, 2025 at 3:22 pm #17398318

fredericG-12

Hello Bigul,

Thanks for your reply.

> I hope you are following the steps outlined in this documentation to set up the Language Directory for the default language

Yes we do.

> Upgrade to the latest version of WPML plugins (4.8.1 series)

WPML or WordPress does not offer any upgrade, please see the attached screenshot.

How come the latest version is not detected right out of the box? Is this another bug?!

Thank you

Screenshot from 2025-09-12 17-20-46.png
September 12, 2025 at 4:48 pm #17398441

Bigul

Hello,

Thank you for the updates. Please go to Plugins >> Add Plugins >> Commercial tab and click on the "Check for updates" button. This will refresh the installer cache and display the automatic upgrade links for the latest version of WPML.

Please try this after taking a full site backup and let us know your feedback.

--
Thanks!

Bigul

Screenshot 2025-09-12 at 10.16.50 PM.png
September 16, 2025 at 12:03 pm #17406014

fredericG-12

Thanks for your reply.

The issue with the updates was that I forgot to change the WMPL key for the staging site.

I was able to update WPML to the latest versions.

Here is the result for the endless redirection loop issue: still the same unfortunately.

Please let me know if you need anything else to help look into that bug.

September 18, 2025 at 6:21 am #17411634

Andreas W.
WPML Supporter since 12/2018

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

Timezone: America/Lima (GMT-05:00)

Hello,

Currently, once I visit your site, I get redirected to hidden link. There is no infinite loop occurring on my test. Anyhow, my browser language is actually set to English.

Could you please pass me the markup of your redirect.html file so that I can try to replicate the issue in a sandbox?

On your site, please verify if there are any unexpected redirects set inside the "Redirection" plugin.

If you would like to give it a try yourself, you can log in to the test site here:
hidden link

Note that I already ran a test, but so far the issue has not occurred, which means the issue might be related to your HTML file or even to some code inside the theme or another plugin.

Best regards
Andreas

September 19, 2025 at 12:11 pm #17416699

fredericG-12

Hello Andreas,

Thanks for your reply.

The logimatiq.com website has the WPML SEO plugin deactivated.

Here is the markup of the redirect.html file:
```
<html>
<head></head>
<body>
<script>
var userLang = navigator.language || navigator.userLanguage;
var urls = {
'en': 'en/',
'fr': 'fr/',
'de': 'de/'
};
var defaultUrl = 'fr/';

var url = urls[userLang.substring(0,2)] ?? defaultUrl;

//console.log(userLang.substring(0,2), window.location.href + url);

window.location.href = window.location.href + url;
</script>
</body>
</html>
```

The endless redirection loop happens when the WPML SEO plugin is active.

The Redirection plugin has no effect on this, whether it is active or not does not change the issue.

Of course our website setup is different from your test site.

How can I give you access to the staging site so you can test yourself?

September 19, 2025 at 12:55 pm #17416924

fredericG-12

Hello again,

We were able to pinpoint the issue:

There was a redirection set from en/ to / inside the Yoast SEO Premium plugin.

Thanks for your help and sorry for the fuss.