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.

This topic contains 1 reply, has 2 voices.

Last updated by Andreas W. 1 year, 1 month ago.

Author Posts
May 3, 2024 at 8:43 pm #15592813

Sytse

I need to change the Language URL format from parameter (example *.com?lang=en) to direcory (example *.com/en/)
After I change this setting, I want old links automatically to be redirected to the new format.
So if someone enters the old url format .com/contact/?lang=en, he automatically need to be redirected to .com/en/contact/
This does not happen automatically. Can I make a setting for this in WPML? Or can I include rules for that in the htaccess?

May 3, 2024 at 11:59 pm #15592974

Andreas W.
WPML Supporter since 12/2018

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello,

WPML does handle this automatically.

Only once you change the settings save the WordPress Permalink settings.

Example:
If a link points to .com/contact/?lang=en then WPML will redirect to .com/en/contact/

If this still does not work as expected, please provide us with an example that shows the issue.

A link, screenshots, or a video would be helpful.

Best regards
Andreas

May 8, 2024 at 7:01 am #15604426

Sytse

Andreas, thanks for your support.

Unfortunately, this did not work automatically for me. All links with the 'old' structure, led to the homepage of the main language. There was also the problem that the links in the navigation were converted to the new structure, but not on the pages themselves. Probably because we ourselves put static links in here instead of dynamic ones. Or an incompatibility with Elementor. So problem not solved, but unfortunately for this topic I choose to solve it differently.

For now, I will keep the same link structure, but choose not to have the language selection redirected by the browser, as this caused problems with Google canonical links.

Sytse