This thread is resolved. Here is a description of the problem and solution.
Problem:
The client is experiencing an issue where clicking on the 'Japanese' language link on their WordPress site redirects to the wrong page instead of the Japanese translated page.
Solution:
We discovered that the issue was caused by custom redirect code in the
wp-config.php
file, which was incorrectly redirecting Japanese language links to the homepage. To resolve this, we commented out the problematic code:
// Redirect any /en/ URL to homepage<br />$request_uri = $_SERVER['REQUEST_URI'];<br />if (preg_match('#^/en(/|$)#i', $request_uri)) {<br /> header("Location: https://versa-networks.com/", true, 301);<br /> exit;<br />}<br /><br />if (preg_match('#^/ja(/|$)#i', $request_uri)) {<br /> header("Location: https://versa-networks.com/", true, 301);<br /> exit;<br />}
After making this change, the redirection issue was resolved. We recommend clearing all sorts of cache and verifying if the issue persists.
Please note that this solution might be irrelevant if it's outdated or not applicable to your 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.
This topic contains 4 replies, has 0 voices.
Last updated by 2 weeks, 6 days ago.
Assisted by: Noman.