Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
If you browse to the website without the language suffix (e.g., https://telium.io), the site renders incorrectly. This issue is likely related to how WPML handles redirection and language URL settings.
Solution:
We recommend checking the WPML settings under WPML → Languages → Language URL format. If you have the option 'Use directory for default language' enabled, you have two main options:
1. Uncheck the 'Use directory for default language' option. This change will allow https://telium.io/ to display the root page as intended.
2. Set up a redirect from https://telium.io/ to https://telium.io/en/ if you prefer to keep using the 'Use directory for default language' setting. You can find detailed instructions on setting up this redirect here.

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.

Tagged: 

This topic contains 5 replies, has 2 voices.

Last updated by Andrey 3 months ago.

Assisted by: Andrey.

Author Posts
August 6, 2024 at 12:24 pm #16043934

technicalS-2

If you browse directly to the website with the language suffix (hidden link ) then the site renders correctly as shows in attached images good1 and good2.

If you browse to the website without language suffix (hidden link ) then the site renders incorrectly as shown in images bad1 and bad2.

Somehow the WPML plugin/redirection/code is causing the site to malfunction. I don't think its CSS related, since I moved the entire site to a new host (running more recent wordpress + php), and then the problem appeared. All worked fine on the old host. And since the buy occurs only with WPML redirection/language suffix on the URL all signs point to WPML.

August 6, 2024 at 12:42 pm #16043996

Andrey
Supporter

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+02:00)

I noticed you use the option 'Use directory for default language' in WPML → Languages → Language URL format. So, basically, when you visit the website at hidden link, a root page should be shown since the homepage becomes hidden link for the default language. I can suggest you one of a few options:

– Uncheck the option 'Use directory for default language'. Then hidden link will be shown as it is supposed to.

– Set up a redirect from hidden link to hidden link if the option 'Use directory for default language' is being used as explained here: https://wpml.org/documentation/getting-started-guide/language-setup/directory-default-language/#redirect-the-root-domain-to-the-default-language-directory

August 6, 2024 at 2:04 pm #16044378

technicalS-2

Ok I unchecked the Use Directory for default language option. While this works, it will impact my SEO since search engines used the old URL with language suffix.

Is this a bug that will be fixed in a future release?

August 6, 2024 at 2:27 pm #16044459

Andrey
Supporter

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+02:00)

I'm not certain if this is a bug or a compatibility issue with your current theme. When you use the root page but specify the index.php file, it may be incorrect if you don't have a root page on index.php.

Another option is to leave the URL structure as it is and set up a redirect as I mentioned earlier.

August 13, 2024 at 12:37 am #16064132

technicalS-2

Since WPML does the redirect on its on (from / to /en suffix) I don't think I should have to setup a redirect. The theme works fine without WPML...this is somehow a WPML bug

August 13, 2024 at 12:43 pm #16066438

Andrey
Supporter

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+02:00)

WPML will not redirect / to /en if using the directory for the default language because on / expected a root page. This redirect should be created on your own. However, redirecting to a post or a page should work as expected; for example, your site.com/about-us/ should be redirected to site.com/en/about-us/.