Skip Navigation

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.

Sun Mon Tue Wed Thu Fri Sat
- 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 -
- 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Tagged: 

This topic contains 3 replies, has 3 voices.

Last updated by Long Nguyen 1 year, 9 months ago.

Assisted by: Long Nguyen.

Author Posts
September 7, 2023 at 1:33 pm #14359989

brianR-8

Hi there!

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.

Thanks for your help!

September 8, 2023 at 7:24 am #14363933

Dražen
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hello,

thanks for contacting us.

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.

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

Regards,
Drazen

September 8, 2023 at 2:33 pm #14367507

brianR-8

Hi Drazen,

Thank you for your answer.

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!

September 11, 2023 at 7:13 am #14372973

Long Nguyen
WPML Supporter since 02/2022

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi Brian,

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.