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.
|September 19, 2019 at 8:28 am #4602561|
Although the code snippet outlined within this previous thread
appears to be a good fit for a website I'm managing, I still would like to ask you a couple of additional questions in this regard.
We have three language versions; after have changed the URL language format from
I'd like to redirect the former URL versions to the actual ones.
1) As stated before, this code snippet apparently fits my situation. However, it is designed for lang=en only. How could I also include lang=ru in it?
2) "Please use this .htaccess content and put it above the current content for WordPress."
What this actually mean? Do I have to place this code snippet as the very first entry in the .htacces, above any other line of php-code?
Thank you in advance for any valuable hint!
|September 20, 2019 at 11:31 am #4611743|
Languages: English (English )
Timezone: Asia/Kolkata (GMT+05:30)
Since you have mentioned the rewrite rule works for you just for English, in that case, I would suggest adding a regular expression match in lang and pass the expression to rewrite rule would solve your issue.
Alternatively, you can add another rule for other languages as you did for English.
Please refer to this URL for some clarification on how to handle them hidden link
Please also exclude wp-json as you did for wp-admin.
Since we dont have any redirect script ready, I would suggest sending this as a feature request so that changing from parameter URL to directory URL is handled by default in WPML core https://wpml.org/suggest-a-new-feature-for-wpml/
I hope this helps you better.