[Resolved] Pressing the switcher redirects me to the default language.
This thread is resolved. Here is a description of the problem and solution.
Problem: When using the WPML language switcher on a website, pressing the switcher redirects back to the default language instead of maintaining the selected language. Solution: 1. Check and revise the DNS entries. Consider disabling services like Cloudflare/Cloudfront and Kinsta caching to see if this resolves the issue. You may need to contact your hosting support for assistance. 2. Ensure that the server configuration is correctly set up for sites in a subfolder. This involves checking the rewrite rules in either the
.htaccess
file or the
nginx.conf
file. If these steps do not resolve the issue, we may need to create a duplicator package of your site to further diagnose the problem. For more details on how to provide a duplicator package, please visit https://wpml.org/faq/provide-supporters-copy-site/.
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 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.
Background of the issue:
I am working on translating an article for testing purposes using WPML on my website hidden link. The specific article I am translating can be found at hidden link.
Symptoms:
When I press the language switcher on the page, it redirects me back to the default language, which is Japanese, instead of maintaining the selected language.
Questions:
Why does pressing the language switcher redirect me to the default language instead of staying on the selected language?
Is there a specific setting or configuration in WPML that I need to adjust to fix this issue?
I’ve removed the sub-directory “/media” in secondary language URL input fields from WPML >> Languages > Language URL format as you can see in the attached screenshot and re-saved the permalinks from the Settings >> Permalinks page and now it seems to be working correctly. Could you please check and confirm?
There is one more thing I don't understand.
How do I translate the categories and other untranslated parts of the English and Chinese translations as shown in the attached image?
3. For the original redirection issue, I’ve tried troubleshooting steps but none of them worked so far, I’m going to escalate this issue to our 2nd tier support for further review.
We can't access the WP login page; it shows a 404 error (see attached screenshot). Can you please check and fix this issue so our 2nd tier support can investigate further?
I have restored yesterday's backup and it has not improved.
I contacted the Kinsta engineers and it seems to be redirecting. hidden link
↓↓ hidden link
I have not done any work on my end, did you change any settings?
I checked for theme/plugin conflicts and enabled error reporting, then reverted the changes, and the site was working correctly. Hosting support may be able to help with this.
I was able to log in.
It is a SWELL theme, but the child theme seems to have interfered with it, so it is in parent theme status.
Also, the kinsta engineer gave me some information to refer to.
Best regards.