This thread is resolved. Here is a description of the problem and solution.
Problem:
How to always redirect to the default language directory. Solution:
Create a page for the root url of the website, WPML -> Languages -> Language URL format.
Create a redirect template and use it on the root url page.
Unfortunately, i have noticed the homepage default redirection is also incorrect! If I type hidden link does not redirect to hidden link - although the latter URL no longer returns a 404 error.
I see you selected to Use directory for default language, which is the first step to what you want to achieve.
The next step will be to add a page for the root url. That page will use a template that will immediately redirect to the home page, with the directory.
I see you followed the documentation, which should have achieved your request. I can't know for certain why it didn't without further investigation.
In order to do that I will need access to your website, preferably a staging one where the issue is replicated. Please make sure you backup your website before proceeding.
If it is a production website, I will be extra careful, and let me know if I do not have permission to change any settings.
Your next reply will be private so you can share sign in details.
I just visited your website and I believe I have an answer. First I tried going to the home page and as you said it does not redirect. Then after logging in I tried again and this time the redirect did work.
I checked and saw that you are using WP Rocket for caching.
I believe that you have a cached version of the page before you changed it to use the redirect template. The reason it works after logging in is that WP Rocket has a setting to use cache for logged in users which you left disabled. The reason the cache doesn't use the new version is that the cache time-to-live is unlimited.
To fix this you need to reload your cache so that it uses the update page. hidden link
I added a short video for clarity. hidden link?
You have given me an idea... I have switched on the "Never cache this page" option of WP Rocket on WPML's Root redirect. I have cleared all the cache, and now it works as it should.
Thank you for your time and for helping me think through this again!
That's great to hear! I'm glad your issue has been resolved. Thank you and have a great day!
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.