Skip Navigation

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

Problem:
The client's site loads 'broken' when accessed without specifying 'EN' or 'FR' in the URL. This issue occurs when the WPML plugins are active.
Solution:
We recommend checking if you are using the 'Use directory for default language' option in WPML, which requires setting up a Root Page. For more information on what a Root Page is and whether you need one, please visit What is a Root Page, and do I need one?
Additionally, consider setting up a redirection from the root domain to the default language directory. Detailed guidance on this can be found here: Redirect the root domain to the default language directory

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 issues persist, 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.

This topic contains 4 replies, has 1 voice.

Last updated by Andrey 1 week ago.

Assisted by: Andrey.

Author Posts
March 27, 2025 at 3:28 pm #16869139

thomasT-21

Background of the issue:
We're working on a site that's behind our firewall and not live yet: hidden link. It's a single site version of a current multisite production site. We'd like the site to default to hidden link when a user in the US accesses it. Entering that manually works fine. However, when hitting the URL without EN or FR, the site loads 'broken'. The language switcher works and the French version of the site works as well: hidden link. When we turn off our WPML plugins, the URL hidden link works without issue.

Symptoms:
The site loads 'broken' when accessed without specifying EN or FR in the URL.

Questions:
Do we need to adjust a setting in WPML or change something in htaccess or wp-config?

March 27, 2025 at 4:17 pm #16869623

Andrey
Supporter

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

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

One of my colleagues will be handling your ticket. In the meantime, I'd like to share some helpful information.

You might be using the "Use directory for default language" option, which requires a Root Page.

What is a Root Page, and do I need one?
https://wpml.org/documentation/getting-started-guide/language-setup/directory-default-language/#what-is-a-root-page-and-do-i-need-one

You could also consider redirecting the root domain to the default language directory:
https://wpml.org/documentation/getting-started-guide/language-setup/directory-default-language/#redirect-the-root-domain-to-the-default-language-directory

March 31, 2025 at 1:01 pm #16879436

thomasT-21

Hi,

Yes, we still need assistance please. We confirmed that we are using a root page and that the root page seems to exist and it's the same setup and root page as the original site, so that was transfered over correctly.

Again, these work:
hidden link
hidden link

The question is why this:
hidden link
Doesn't automatically redirect to:
hidden link (if the user has EN locale set)
or
hidden link (if the user has FR locale set)
We'd like it to default to EN if no locale is set or if the locale doesn't match EN or FR.

We do have root-rediect.php template and I tried to update the root page to use it, however, it won't let me save it, strangely. I can probably update it on the database side though (?)

Please confirm what these should be:
WordPress Address (URL) Currently --> hidden link
Site Address (URL) Currently --> hidden link

I know the redirect page uses home_url(), which (if either) of those addresses does it use? If my research is correct, it uses the "Site Address" ?

Please advise. Thank you.

March 31, 2025 at 2:36 pm #16879959
thomasT-21

Hi,

Quick update we were successful editing the root page to the root redirect template. The base url is now /en so it seems like everything is working as expected.

We are seeing another weird issue of an .htaccess file being created after making a change in Settings --> General that was causing the site to crash (500 error) we found and deleted the file and everything worked again. Not sure what that story is with that. The htaccess file was being created in the root or where it didn't seem to belong. Any ideas?

Thanks.

March 31, 2025 at 3:28 pm #16880173

Andrey
Supporter

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

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

I'm glad to hear that it now works. As the original issue is resolved, I opened a new ticket to answer your new question. This will also help other users with similar problems find solutions when searching the forum.

I will reply here: https://wpml.org/forums/topic/split-weird-issue-of-an-htaccess-file-being-created-after-making-a-change-in-settings-general-that-was-causing-the-site-to-crash-500-error/