This thread is resolved. Here is a description of the problem and solution.
Problem: When using WPML on a multilingual site with subdomains for different languages, switching from a German page to an English page results in a 404 error if the English translation is not available. This issue does not occur when switching from German to Estonian or from English to German. Solution: We recommend checking the settings for 'Link to home of language for missing translations' in WPML. If this setting is correct and the issue persists, consider the following steps: 1. Delete the category (e.g., Griechenland) for the English language, which will then redirect users to the homepage when switching from the German version, similar to the behavior observed when switching to Estonian. 2. Alternatively, complete the translation for the missing content (e.g., trips under the Griechenland category) in English. This will likely resolve the 404 error by displaying the translated trips instead of an error page. For detailed guidance on setting the WordPress administration language, visit Setting the WordPress Administration Language.
Please note that this solution might be outdated or not applicable to your specific case. We highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the issue persists, please open a new support ticket.
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.
Background of the issue:
I use WPML for my multilingual site with different subdomains for different languages. The German subdomain is de.natourest.ee, and the default page is in English at natourest.ee. I want to switch between languages on my site.
Symptoms:
When switching from a German page to English, if there is no English translation available, a 404 Page Not Found message appears instead of redirecting to the English front page. This issue does not occur when switching from German to Estonian or from English to German.
Questions:
How can I fix the issue of getting a 404 error when switching from a German page to English if no translation is available?
Please ensure that the option "Link to home of language for missing translations" is enabled in WPML under Settings > Language Switcher Options, located in the "How to handle languages without translation" section.
If the issue persists, check if there is a translation in different statuses for the page and delete it.
If the problem still continues, please provide the links where the issue can be observed.
"Link to home of language for missing translations" is enabled in WPML under Settings > Language Switcher Options, located in the "How to handle languages without translation" section. - that's the first thing I did.
But I can't understand what do you mean with: If the issue persists, check if there is a translation in different statuses for the page and delete it.
However, like I wrote, the setting Link to home of language for missing translations works perfect by switching from German to Estonian, but not from German to English: hidden link
I need to request temporary access (wp-admin and FTP) to your site – preferably to a test site where the problem has been replicated if possible – in order to be of better help. You will find the needed fields for this below the comment area when you log in to leave your next reply. The information you will enter is private which means only you and I can see and have access to it.
I have reviewed your website, and it appears that it does not redirect to the homepage because some translations are incomplete or exist.
Let's use this example:
However, like I wrote, the setting Link to home of language for missing translations works perfect by switching from German to Estonian, but not from German to English: hidden link
When you open this page hidden link, you can hover over the language switcher flags. You'll see that selecting Estonian leads to the homepage, while selecting English leads to hidden link, which results in a 404 error, as you reported.
If I navigate to the Griechenland category, I can see that it already contains two trips, but none are available in Estonian. If I click on the count, I can view those trips. Therefore, I suggest the following options:
- Either delete the Griechenland category for the English language, which will then lead to the homepage from the German version, just like with Estonian.
- Or complete the translation of those trips, which will likely display the trips instead of showing a 404 error.