Skip Navigation

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

Problem:
The client wants to set up WPML so that all languages, including the default, are in subdirectories without creating a root page for the site.
Solution:
We recommend setting an empty root page with a specific PHP template to automatically redirect visitors to the default language directory. This approach prevents both URLs (domain.com and domain.com/uk) from being accessible simultaneously and avoids duplicate content issues with Google. Here are the steps to implement this:
1. Select "Edit root page" and create an empty WordPress Page.
2. Follow the instructions to create a PHP template with the redirect.
3. Assign the template to your empty root page.
For detailed guidance, refer to the section "Redirecting the Root Domain to the Default Language Directory" in our documentation here.

If this solution does not apply to your case, or if it seems outdated, 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 further assistance is needed, please open a new support ticket here.

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.

This topic contains 1 reply, has 0 voices.

Last updated by Nicolas V. 1 week, 3 days ago.

Assisted by: Nicolas V..

Author Posts
November 19, 2024 at 4:54 pm #16420875

jacynH

Background of the issue:
I am trying to create a site structure so that both languages including the default language are in sub directories, but without creating a root page for the site. There are only 2 languages at the moment: hidden link - This is to be the default language and will show if the visitor visits from outside of AU. hidden link Eventually there will be more languages.

Symptoms:
I found documentation but it’s not quite what we want as we don’t want a root page.
https://wpml.org/documentation/getting-started-guide/language-setup/directory-default-language/

Questions:
How can I set up WPML to have all languages, including the default, in subdirectories without a root page?

November 20, 2024 at 1:21 pm #16424820

Nicolas V.
Supporter

Languages: English (English ) French (Français )

Timezone: America/Lima (GMT-05:00)

Hello,

Welcome to the WPML support forum.
You found the correct documentation but I think there is a confusion. You don't have to set up and design a root page. But I would still strongly recommend to set an empty root page with a specific PHP template to automatically redirect to the default language directory.

This will prevent to have both urls domain.com and domain.com/uk accessible, and avoid duplicate content issues with Google. Visitors accessing domain.com we be automatically redirected to domain.com/uk. In short, this page is only a redirect.

This solution is at the very end of the documentation, section "Redirecting the Root Domain to the Default Language Directory".

Steps:
1. Select "Edit root page" and create an empty WordPress Page
2. Follow the instructions and create a PHP template with the redirect
3. Assign the template to your empty root page