Skip Navigation

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

Problem:
The client was attempting to change the language URL format from a parameter to different languages in directories, but encountered issues where the settings would not save and the site would revert to using language parameters.

Solution:
1. We verified that there was no redirect file in the root directory where WordPress is installed.
2. We created a redirect file named

wpml.php

, added the necessary Header information, and set up a redirect from the main domain to the '/sk' directory for the Slovak version of the site.
3. After these changes, the site successfully redirected to the Slovak version, and the issue with the blank page on the main domain was resolved.

If you're experiencing a similar issue, we recommend checking for the presence of a redirect file in your root directory and ensuring it's correctly configured. For more information on setting up language directories, please refer to our documentation on Language URL options and redirecting the root page of your site.

Please note that the solution provided might be outdated or not applicable to your case. If the issue persists, 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 you still need assistance, please do not hesitate to open a new support ticket in our support forum.

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 16 replies, has 3 voices.

Last updated by Prosenjit Barman 11 months, 4 weeks ago.

Assisted by: Prosenjit Barman.

Author Posts
February 2, 2024 at 9:53 am #15258334

viliamM

Hi,

I am trying to change the setup instead of Language name added as a parameter to Different languages in directories. it is not working for me.

1) I reviewed this article https://wpml.org/documentation/getting-started-guide/language-setup/language-url-options/cannot-activate-language-directories/

2) I created the redirect file based on this article https://wpml.org/forums/topic/redirect-the-root-page-of-my-site-to-the-url-mysite-com-en/

3) When I make the saving - all looks ok; then i come to permalink - i select the custom time as requested in the article, but then it is changed to hidden link

4) When I returned back to the Language setup page - I can see that nothing had changed - back to the Language name added as a parameter

I tried to deactivate all the plugins except WPML and the Divi theme plugin, but the result is the same.

Can you help me to fix this problem?

2024-02-02_10-48-27.jpg
2024-02-02_10-48-14.jpg
2024-02-02_10-47-56.jpg
2024-02-02_10-47-38.jpg
2024-02-02_08-24-42.jpg
February 2, 2024 at 10:29 pm #15261401

Bobby
Supporter

Languages: English (English )

Timezone: America/Los_Angeles (GMT-08:00)

Hi,

I understand you would like to use the language URL format for "different languages in directories", do you also need to use the directory in the default language as well?

by default with "different languages in directories" it will look like this:

site.com (default language) and site.com/en/ (english)

if you enable the second option your default language URL will look like site.com/sk/

You can use either or, and the directory for the defautl language does not need to be enabled, in which case you do not need to setup the HTML file.

February 2, 2024 at 10:37 pm #15261404

viliamM

I want to make it the second advised option - so the default site shall be site.com/sk

February 2, 2024 at 10:54 pm #15261409

viliamM

Now, when I logged into the dasboard - i can see, that finally i have changed to the directories - you can see the attached images.

There are several problems:

1) Although - I have created the redirect - notning is redirected - when i go to demo.hobbyhorseslovakia.com - it will open the blank page - and I can also not see wmpl text in the source file - so something is wrong

2) when I go directly to demo.hobbyhorseslovakia.com/sk - the original homepage will open, and I can browse the page - the problem is, that when I update something via Divi editor - then save the page - but when I browse the page - I cannot see anything changed - the original version is displayed

2024-02-02_23-47-32.jpg
2024-02-02_23-46-32.jpg
2024-02-02_23-45-21.jpg
February 2, 2024 at 11:00 pm #15261453

viliamM

Now, I changed it - and unchecked the Use directory for default language - I was able to save it - but - when I browse demo.hobbyhorseslovakia.com - a blank page will open again.
When I browse demo.hobbyhorseslovakia,.com/sk - the default language version opens.

I have also saved the permalinks, but the result is the same.

I also tried to cler the browsing cache, incognito mode. I deactivated all cache plugins.

February 2, 2024 at 11:07 pm #15261456

viliamM

Although - my option is to have the country code also on the default language, we need to fix these two mentioned issues.

February 2, 2024 at 11:11 pm #15261457

viliamM

this is what is displayed in the divi builder and then saved on the page
you can browse it to see what you will see there

hidden link

February 2, 2024 at 11:16 pm #15261460

viliamM

last point - i deactivated all plugins except divi and wpml - and i cannot see the page like in the builder - i still can see the old version of the page.

February 4, 2024 at 7:35 pm #15263914

viliamM

Sorry, don't perform any updates on my demo site for now. I need to go into the production with existing pages - then when I will create another instance for testing and will return back.

February 5, 2024 at 11:01 am #15265426

Prosenjit Barman
Supporter

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hello There,
I hope you're doing well. Sorry for the delay in responding due to the weekend.

Thank you for consistently updating me on this issue. I want to assure you that creating a redirect file is not necessary if you aim to show the default language directory in the URL. By simply turning on the "Use Directory for Default Languages" option, the directory should automatically be included in the URL.

If you encounter an issue with a blank page, you might want to reconsider the configuration under the "Use Directory for Default Languages" setting. Instead of choosing the "HTML File" option, try selecting "A Page" [ Screenshot: hidden link ], then save your adjustments and re-save the permalink structure. This should ensure that the default language code is displayed as a directory in the URL.

Please let me know if that helps or if you need further assistance in this matter. I will wait for your update and be happy to assist you further in this matter.

Best regards,
Prosenjit

February 8, 2024 at 3:00 pm #15281922

viliamM

I want to continue collaborating with the setup for different directories and would also like to use the directory for the default language. I also need to use the specific HTML or PHP page there for redirecting as I need to open the exact page version.

Also, the best way for me would be to open the Slovak version of the page when the user's browser is set to Slovak or Czech and then open the English version for all the other cases. WPML is not supporting a such functionality I assume.

February 9, 2024 at 8:32 am #15284340

Prosenjit Barman
Supporter

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hello There,
Thank you for the update.

If you want to use the HTML file option, please add a slash (/) just before the file name. This indicates WPML to look for the file in the root directory. I hope it will help.

But, if you want to redirect users to language versions based on the user's browser language, you can also do that from WPML. From "WPML > Languages", scroll down to the "Browser language redirects" section. Choose the 2nd or 3rd option and save the changes. Please check the guide below to learn more about the process.

- https://wpml.org/documentation/getting-started-guide/language-setup/automatic-redirect-based-on-browser-language/

Please feel free to let me know if you need further assistance in this matter. I will be happy to help.

Best regards,
Prosenjit

February 15, 2024 at 2:04 pm #15307639

viliamM

Hi,
do you mean like this? See the screenshot?
When I refresh the page - I see there is just the file name without the slash "/."
When I browse the page, I can see just a blank page - no redirection occurs.

Can you check and help me to setup it?

2024-02-15_15-02-53.png
February 16, 2024 at 5:59 am #15309982

Prosenjit Barman
Supporter

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hello There,

I can surely help you to set this up!

I would like to request temporary access (wp-admin and FTP) to your site to take a better look at the issue. It would be better to have a testing site where the issue is replicated.

You will find the needed fields 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.

IMPORTANT
-Please backup site files and database before providing us access.
-If you do not see the wp-admin/FTP fields this means your post & website login details will be made PUBLIC. DO NOT post your website details unless you see the required wp-admin/FTP fields. If you do not, please ask me to enable the private box. The private box looks like this:
hidden link

Looking forward to your response.

Best Regards,
Prosenjit

February 16, 2024 at 1:45 pm #15311949

Prosenjit Barman
Supporter

Languages: English (English )

Timezone: Asia/Dhaka (GMT+06:00)

Hello There,
Thank you for sharing the access information.

I've inspected the root directory (where WordPress is installed) and didn't locate any redirect file. Consequently, I created one (named wpml.php), inputted the Header information, and configured a redirect from demo.hobbyhorseslovakia.com to demo.hobbyhorseslovakia.com/sk. For reference, here's a screenshot: hidden link.

Following these changes, I was successfully redirected to the Slovak version of the site, which also resolves the issue of a blank page being displayed on the main domain.

Please let me know if that helps or if you need further assistance in this matter. I will be happy to help.

Best regards,
Prosenjit