WordPress - Troubleshooting - I clicked on a link and I am redirected to my original language

In this article, you'll learn how to troubleshoot why you're redirected to your original language when clicking on a link. 

 

 

 

Missing trailing Slash "/" at the end of the URL

 

As you can see in the screenshot below, the URL in the source of the "a" tag is http://www.rmfhk.com/zh/storyteller.


There is no trailing slash ("/") at the end of the URL. You can check this by going to your browser inspector (right click > "Inspect").

 

 

That is the reason why you are redirected to the URL of your original web page language.
You need to add a trailing slash ("/") at the end of the URL (directly in the source of your "a" HTML tag). 

 

You can use plugins such as WP Rocket (https://docs.wp-rocket.me/article/131-redirection-to-enforce-trailing-slash-on-urls) or Yoast (https://yoast.com/change-wordpress-permalink-structure/) to help you to add a slash at the end of the URLs regarding the ones that make you lose the current language.
 
As you can see below, the URL in the source of the "a" tag is now http://www.rmfhk.com/zh/storyteller/, with a slash at the end of the URL.
 

 

It's now working properly, and you'll navigate to the translated page without being redirected to the original language.

 

 

Wrong URL shape

 

If your URL slug has a port number like this:  http://192.168.42.98:8510

 


The port number ":8510" is causing the issue. Remove it, and it will work properly.


Absolute and relative URL

 

Ensure that the URL used in your HTML source code is the absolute URL (for example, https://www.mywebsite.com/product/) and not the relative URL (/product/). 

 

Give feedback about this article

Was this article helpful?