Home›Support›English Support›[Resolved] 404 error on a server level due to misunderstanding between WPML and Woo
[Resolved] 404 error on a server level due to misunderstanding between WPML and Woo
This thread is resolved. Here is a description of the problem and solution.
Problem: You are experiencing a 404 error on your WordPress site after installing WooCommerce and during updates. This issue arises because WPML sets the default language to BG, and WooCommerce rewrites the path in the .htaccess file, leading to a redirection to a non-existent /bg/ page. Solution: We recommend testing this on a clone of your site with only WPML, WooCommerce, and WooCommerce Multilingual enabled, without any other third-party plugins. This will help determine whether the issue is solely due to WooCommerce or if it arises from an interaction with an add-on.
If this solution does not resolve your issue or seems outdated, please check the related known issues and verify that you have installed the latest versions of themes and plugins. If the problem persists, we highly recommend opening a new support ticket for further assistance. You can do so 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.
Background of the issue:
I have an issue with my WordPress site, hidden link, caused by a misunderstanding between WPML and WooCommerce. The problem occurs after installing WooCommerce and during updates, leading to a 404 error. The hosting company explained that the error is due to changes in the .htaccess file during WooCommerce updates. WPML sets the default language to BG, and WooCommerce rewrites the path in the .htaccess file, redirecting to a non-existent /bg/ page. The hosting company provided a correct .htaccess configuration: RewriteEngine On RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] RewriteBase / RewriteRule ^index.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] . The default language of the site is BG, and I haven't created the WooCommerce shop yet.
Symptoms:
404 error on a server level due to a misunderstanding between WPML and WooCommerce.
Questions:
How can I fix the collaboration of WPML and WooCommerce, so that they don't cause a 404 error and don't rewrite the htaccess file?
before your ticket is assigned to one of my colleagues, please allow me to walk you through some initial debugging steps. This will help speed up the support process.
Hi Marcel,
I've read the link you gave me and I've discussed it with my hosting provider support, but they say that the "flush_rewrite_rules(true)" can be only a temporary solution. But not good for a long term, as it can lead to misfunction in other plugins.
It would be great if you can assign my ticket to someone who will assist me to find a permanent solution.
There is no alternative solution available, but rest assured that keeping the workaround active long-term should not cause any known issues. This approach has been confirmed by many of our clients who have successfully used it for years without problems.
Unfortunately, we cannot offer a different solution, as this issue typically arises when third-party plugins call the function excessively. If you'd prefer not to keep the workaround in place indefinitely, you can analyze the issue locally to identify which plugins are overusing the function. The best way to do this is by performing a search in your IDE. Based on our experience, Yoast SEO and Redirect plugins are good starting points to check, as they significantly influence rewrite rules.
Thank you for your reply!
I have one important question. I do use Yoast Seo and a redirecting plugin on my site, but they have been active for more than a year and caused no issue in that time. I have installed the WooCommerce later and at the installation itself led to 404 error. Then every time I update the Woo, the 404 appears again. So, my question is, do you think that it may be other plugin causing the issue or I can be sure it is the Woo?
Yes, I know from the provided debug info, which is why I made those specific suggestions.
Based on your description, there’s a strong likelihood that the issue is caused by WooCommerce. However, I recommend testing this on a clone of your site with only WPML, WooCommerce, and WooCommerce Multilingual enabled, without any other third-party plugins. This will help determine whether WooCommerce alone is responsible or if the issue arises from an interaction with an add-on.