I created a few posts in English and French. In French, the URL end up with ?lang=fr and it works well. But if I remove the parameter, the French URL redirect to the English URL.
Here an example: hidden link
I need the French url to be working without the parameter and without the redirect to the English version. When clicking on En or Fr (left top), it should display the page in Fr or En.
To give more context, the French URL work well on pages (but not on posts). It's a custom theme made by another developer.
I'm not sure if I missed an option somewhere in your plugin or if this has to do with the theme.
I need the French url to be working without the parameter and without the redirect to the English version.
I am afraid that is not possible or how WPML works, Your translated pages need to have language code or language parameters in order to work and open correctly.
The only what I can suggest is to try using language directory mode if that suits your needs better. Different languages in directories – like wpml.org/es/ for Spanish and wpml.org/de/ for German.
I'm seing in the theme that there is a custom function to remove the lang query.
But this doens't explain why there is a redirect only on post content.
Is there any WPML option I'm missing?
Example: hidden link
If I remove ?lang=fr, the url redirect to the English version: hidden link
In WPML, the browser language redirect is disabled.
As I said previously, there is no redirect for the page content type.
Example:
If I remove ?lang=fr from hidden link, the url will still be the french version hidden link
Please lmk if I'm missing an option in your plugin (for the post content type) or if this has to do with how the theme is developed.
Thanks!
Yes, "this has to do with how the theme is developed". There is no option that you miss in our plugin settings.
As my colleague said, this is not how WPML works. There must be a language parameter or language code of the second language in the URL to open the page/post correctly.
I'm not sure how the custom function in the theme works but supporting a custom code is beyond our scope. I suggest you contact the theme developer to ask for more information or contact one of our certified partners who will be more than happy to help you with this. In this link, you will find a list of our certified partners: https://wpml.org/contractors/
Regards.
The topic ‘[Closed] French URL redirects to primary language UR’ is closed to new replies.