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?
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
Manage Cookie Consent
We use cookies to optimize our website and services. Your consent allows us to process data such as browsing behavior. Not consenting may affect some features.
Functional
Always active
Required for our website to operate and communicate correctly.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
We use these to analyze the statistics of our site. Collected information is completely anonymous.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
These cookies track your browsing to provide ads relevant to you.