Skip to content Skip to sidebar

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

Problem:
The client's website crashes and displays a 404 error after switching languages multiple times using the language switcher in the footer.
Solution:
We recommend updating WordPress to the latest version as the client was using an older version (v.6.2.5). It's crucial to ensure that a full backup of the website is made before updating. If the problem persists after updating, it may be due to the flush_rewrite_rules(true) function being called too frequently by third-party plugins, which causes the .htaccess file to be overwritten. For more detailed instructions, please visit https://wpml.org/faq/why-is-htaccess-getting-overwritten-with-the-language-folder-on-my-wpml-website/.

If this solution does not resolve your issue or seems irrelevant due to being outdated or not applicable to your 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. Should you need further assistance, please open a new support ticket at WPML 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 5 replies, has 2 voices.

Last updated by Marsel Nikolli 1 year, 11 months ago.

Assisted by: Marsel Nikolli.

Author Posts
May 22, 2024 at 1:37 pm #15658667

cakaloz-danismanlik-ic-ve-dis-

My Website crashes after language changing many times back and forth. I'm using the language switcher at the footer. If i open the website and by default it's in turkish, i switch to english and try to go back to turkish but it crashes

May 22, 2024 at 1:42 pm #15658678

Marsel Nikolli

Hi,

Thank you for contacting WPML Support, I will gladly help you.

I've checked your website, and it works properly without any issues on my end.

- Do you get any error messages or anything similar?
- Can you please share a screenshot of what happens?

* I've noticed from the debug info you provided that you are using WP v.6.2.5, I would suggest updating to the latest version.

* Note: Please make sure you have a full backup of your website before making any updates/changes to your website.

Looking forward to your reply,
Marsel

May 22, 2024 at 1:48 pm #15658713

cakaloz-danismanlik-ic-ve-dis-

I'm getting 404 error. Can you trying switching back and forth between languages many times?

May 22, 2024 at 2:06 pm #15658790

Marsel Nikolli

I was able to see the error after multiple language switching, please proceed with the WP update, and if the issue proceeds check the instructions on this link: https://wpml.org/faq/why-is-htaccess-getting-overwritten-with-the-language-folder-on-my-wpml-website/

Let me know how it goes.

May 22, 2024 at 2:14 pm #15658834

cakaloz-danismanlik-ic-ve-dis-

That seems to resolve the issue. What's the reason of it?

May 22, 2024 at 2:35 pm #15658891

Marsel Nikolli

Glad to hear that your issue is resolved.

As described in the link I shared before, the issue is caused by the flush_rewrite_rules(true) function being called too often. This issue is not caused by WPML, it comes from third-party plugins that call that function. This causes WordPress to overwrite .htaccess.

I hope you find that information helpful.

Kind regards,
Marsel