Skip Navigation

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 22 replies, has 2 voices.

Last updated by Long Nguyen 2 months, 3 weeks ago.

Assisted by: Long Nguyen.

Author Posts
July 17, 2024 at 7:00 am #15958387

Ferran

Background of the issue:
Our site hidden link was on AWS hosting using Apache, and we had activated the WPML option: 'Use directory for default language' to redirect 'hidden link' to 'hidden link'. After moving the site to another hosting (wp.com) which uses NGINX, the site in Spanish is not working as expected.

Symptoms:
If you type hidden link it redirects to a post and not the Home page. Navigating through different site sections displays a 404 page.

Questions:
How can we configure WPML on NGINX to use the directory for the default language?
What steps should we take in the WPML troubleshooting section to resolve this issue?

July 17, 2024 at 7:29 am #15964337

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi Ferran,

Thank you for contacting WPML support, I’m happy to help you with this issue.

Do you disable the option "Use directory for default language"? For other pages, I don't see the default language code in the URL. For example
hidden link

Please follow the documentation below to use the option "Use directory for default language", setup the root page and set the redirection to the Spanish language /es/
https://wpml.org/documentation/getting-started-guide/language-setup/directory-default-language/

I also need more information on your site by sharing the debug info. If you don’t know how to share the debug info, please follow this article https://wpml.org/faq/provide-debug-information-faster-support/
Your next reply is enabled to share the debug info.

Looking forward to your reply.
Thanks

July 17, 2024 at 8:06 am #15964660

Ferran

Hi there! and thanks heaps for your reply, I really appreciate your assistance.

- Do you disable the option "Use directory for default language"? For other pages, I don't see the default language code in the URL. For example
hidden link

that is the weird thing, so, the default language on my site is Spanish, if I activate that option, after that, if you type: hidden link it redirects to a random post of the site. 🤷🏻‍♂️
and if you navigate to "inspiracion" or "ciudades" etc... it displays a 404 page, and I don't know why.
because, the other 3 languages work just fine, just try to navigate:

hidden link
hidden link
hidden link

and everything should work...

July 17, 2024 at 8:16 am #15964698

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

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. Your next reply is set to private to share the info.

❌ IMPORTANT: Please backup your database and website before proceeding ❌
You can use this plugin to create the backup: https://wordpress.org/plugins/duplicator/
✙ I would need your permission to de-activate and re-activate Plugins and the Theme to change configurations on the site if needed. This is also a reason the backup is critical.

Looking forward to your reply.
Thanks

July 18, 2024 at 1:47 am #15969080

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi,

1. Regarding the redirection from hidden link to a post hidden link

it is related to the custom theme on your site. If I switch the theme to a WordPress theme (2024), this issue is gone.

2. Regarding the option "use directory for default language", you might need to contact WordPress.com support and ask them to update the Nginx configuration file to handle the language directories properly. Here is an example:

# Handle default language directory
location ~ ^/([a-z]{2})(/.*)?$ {
    set $lang $1;
    set $rest $2;
    try_files $uri $uri/ /$lang$rest /index.php?$args;
}

Looking forward to your reply.
Thanks

July 18, 2024 at 8:19 am #15970855

Ferran

Hi, I appeciate your feedback.

I will have a look to the post redirection but I think it's related to the Nginx config cause when we had the site on AWS hosting everything was working just fine.

I've already sent a message to wp.com support. let's see how they say...

thank you so much for your support and I will keep you updated about any progress

Kind regards,
Ferran

July 18, 2024 at 9:37 am #15971364

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

I'm waiting for your feedback.

Thanks.

July 19, 2024 at 7:39 am #15976414

Ferran

Hi there,
this is the response of wp.com team:

Thanks for the update from WPML. However, some plugins and themes may tell you that to function, they need you to make changes to the NGINX configuration. However, this is not possible here at WordPress.com. Please reach back out to the WPML developers to see if they have any alternative solutions.

so, I would like to ask you if there is a different option besides the nginx config. maybe a function or similar to add in functions.php file?

otherwise I think we are not wil be able to solve this issue.

Highly awaitinbg your reply,
kind regards,

Ferran

July 19, 2024 at 9:50 am #15977196

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi,

I'm not able to access the site with the FTP account. Can you please share it again? Your next reply is set to private to share the info.

Looking forward to your reply.
Thanks

July 22, 2024 at 2:16 am #15984298

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi,

I'm discussing this issue with our 2nd tier support. I will update you here when I have something to share.

Thank you.

July 27, 2024 at 10:23 am #16010482

Ferran

Hi there,
no news yet? it's been a while wih any update, could you kindly tell me how things are going?

thanking you, kind regards,
Ferran

July 29, 2024 at 3:06 am #16013087

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi,

Our 2nd tier support is still investigating the issue, I will let you know when I have more information.
Meanwhile, you can disable the option "Use directory for default language" and still use the URL format language directory for the second languages on your site.

Thanks for your patience.

July 31, 2024 at 9:05 am #16023774

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi,

Our 2nd tier support asks for permission to make some changes on your site, specifically the theme and deactivate some plugins. Please let me know if we can do that on your site because it is related to the WordPress.com hosting, not possible to replicate on another hosting or local host.

Thanks for your co-operation.

August 6, 2024 at 4:31 pm #16044860

Ferran

Hi there and sorry for the late reply.
Summer time here in Spain.

We've already tried to deactivate the Plugins and the problem persists

May I ask what kind of changes on the theme? code?

Awaiting your reply,
Kind regards,

Ferran

August 7, 2024 at 2:37 am #16046011

Long Nguyen
Supporter

Languages: English (English )

Timezone: Asia/Ho_Chi_Minh (GMT+07:00)

Hi,

Yes, our 2nd tier suspects there is an issue in the code and asks for permission to adjust the code in your theme.

Looking forward to your reply.
Thanks