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.

This topic contains 14 replies, has 2 voices.

Last updated by Andrey 1 year, 5 months ago.

Assisted by: Andrey.

Author Posts
October 6, 2023 at 10:48 am #14526511

oliverR-34

I am trying to: Every day when we are going to this page, it shows 404 error. After resaving permalinks it starting to work. We tried different solutions and now thinking that it's connected with WPML.

Link to a page where the issue can be seen: hidden link

I expected to see: Working page without resaving permalinks.

Instead, I got: 404 error every day after some time.

October 7, 2023 at 7:16 am #14531959

Andrey
Supporter

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

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

Could you please update your WPML plugin to the latest version 4.6.6 and add-ons to benefit from the latest bug fixes and improvements? This may not necessarily resolve your problem, however, in order to troubleshoot the issue best we need to work on the latest code available.

You can check the latest released versions under "My Account -> Downloads" on this site. Instructions to update can be found here: http://wpml.org/faq/install-wpml/

Please remember to backup your database first before you proceed! You can use a plugin for this if you like (example: http://wordpress.org/plugins/duplicator/)

Let us know if the issue persists after an update has been done. Does it happen in the default language? Please share the content of the .htaccess file at the moment of the error. It is located at the root of your WP installation.

October 9, 2023 at 9:57 am #14537987

oliverR-34

We are updating plugin each time and right now it has latest version, but error exist. This problem we have for months now.

Right now we are facing a problem (screenshot), but I have to update permalinks to get it work, because shop has clients...

image_2023-10-09_125624262.png
October 9, 2023 at 11:24 am #14538849

Andrey
Supporter

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

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

Thank you for feedback.

Is it happening only in the default language?

Please share the content of the .htaccess file at the moment of the error. It is located at the root of your WP installation.

October 9, 2023 at 12:50 pm #14539711

oliverR-34

Probably yes, in Estonian language we have this issue.

# BEGIN WP-Optimize Browser Cache
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType text/css "access 28 days"
ExpiresByType text/html "access 28 days"
ExpiresByType image/gif "access 28 days"
ExpiresByType image/png "access 28 days"
ExpiresByType image/jpg "access 28 days"
ExpiresByType image/jpeg "access 28 days"
ExpiresByType image/webp "access 28 days"
ExpiresByType image/x-icon "access 28 days"
ExpiresByType application/pdf "access 28 days"
ExpiresByType application/javascript "access 28 days"
ExpiresByType text/x-javascript "access 28 days"
ExpiresByType application/x-shockwave-flash "access 28 days"
ExpiresDefault "access 28 days"
</IfModule>

<IfModule mod_headers.c>
<filesMatch "\.(ico|jpe?g|png|gif|webp|swf)$">
Header set Cache-Control "public"
</filesMatch>
<filesMatch "\.(css)$">
Header set Cache-Control "public"
</filesMatch>
<filesMatch "\.(js)$">
Header set Cache-Control "private"
</filesMatch>
<filesMatch "\.(x?html?|php)$">
Header set Cache-Control "private, must-revalidate"
</filesMatch>
</IfModule>

#Disable ETag
FileETag None
# END WP-Optimize Browser Cache
<IfModule mod_rewrite.c>
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]
</IfModule>
# BEGIN WordPress
# Käsud (read) "BEGIN WordPress" ja "END WordPress" vahel on
# dünaamilselt genereeritud ja neid tuleks muuta üksnes WordPressi filtrite abil.
# Kõik muudatused nende kahe markeri vahel kirjutatakse üle.
<IfModule mod_rewrite.c>
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]
</IfModule>

# END WordPress

# BEGIN Headers Security Advanced & HSTS WP 5.0.29
<IfModule mod_headers.c>
Header set Access-Control-Allow-Methods "GET,POST"
Header set Access-Control-Allow-Headers "Content-Type, Authorization"
Header set Content-Security-Policy "upgrade-insecure-requests;"
Header set Cross-Origin-Embedder-Policy "unsafe-none; report-to='default'"
Header set Cross-Origin-Embedder-Policy-Report-Only "unsafe-none; report-to='default'"
Header set Cross-Origin-Opener-Policy "unsafe-none"
Header set Cross-Origin-Opener-Policy-Report-Only "unsafe-none; report-to='default'"
Header set Cross-Origin-Resource-Policy "cross-origin"
Header set Permissions-Policy "accelerometer=(), autoplay=(), camera=(), cross-origin-isolated=(), display-capture=(self), encrypted-media=(), fullscreen=*, geolocation=(self), gyroscope=(), keyboard-map=(), magnetometer=(), microphone=(), midi=(), payment=*, picture-in-picture=(), publickey-credentials-get=(), screen-wake-lock=(), sync-xhr=(), usb=(), xr-spatial-tracking=(), gamepad=(), serial=()"
Header set Referrer-Policy "strict-origin-when-cross-origin"
Header set Strict-Transport-Security "max-age=63072000"
Header set X-Content-Security-Policy "default-src 'self'; img-src *; media-src * data:;"
Header set X-Content-Type-Options "nosniff"
Header set X-Frame-Options "SAMEORIGIN"
Header set X-XSS-Protection "1; mode=block"
Header set X-Permitted-Cross-Domain-Policies "none"
</IfModule>
# END Headers Security Advanced & HSTS WP

October 9, 2023 at 2:12 pm #14540441

Andrey
Supporter

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

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

Thanks for the update. The .htaccess file seem looks fine.

I think that on this behavior something is influencing. I understand that the shop has clients but we need to find our the reason it is happening.

I suggest you temporarily disable plugin that are not affecting your shop and check if the problem appears. For i.e. Memcached plugin.

If you know how trigger the 404 error, I suggest you temporarily disable all the plugins except WPML and see the results.

Let me know how it goes.

October 9, 2023 at 7:35 pm #14542317

Andrey
Supporter

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

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

You might have the same issue as I described here: https://wpml.org/forums/topic/plug-in-updates-on-wpml-websites-produce-404-errors-through-corrupt-permalinks/#post-14542313

Please test the workaround before troubleshooting your website.

Make sure to back up your site.

October 11, 2023 at 9:29 am #14557595

oliverR-34

Can you comment please why it's happening, that /shop is working, but /pood is not working. And when we will refresh permalink, it will work. I don't think that it's connected with some other plugin and we cannot disable then because of ongoing customers + SEO. Can you propose some solution maybe? Was it happening with some other WPML websites in your experience?

We had same issue before with other website, we put some code in wp-config and now it's working. But we tried same thing here and it's still not working. Really need to solve this ASAP.

image_2023-10-11_122706453.png
image_2023-10-11_122658133.png
October 11, 2023 at 9:32 am #14557695

oliverR-34

Also every time bug is fixed, when we are going to PERMALINK, but NOT RESAVING them. It's funny. So to just going to Permalink page fixing this error for some time, even without updating them. Maybe it will give you some thoughts.

image_2023-10-11_123159594.png
October 11, 2023 at 9:36 am #14557743

oliverR-34

I checked PHP of this permalinks page and there is function flush_rewrite_rules() on init (see screen).

image_2023-10-11_123547169.png
image_2023-10-11_123529697.png
October 11, 2023 at 10:34 am #14558387

Andrey
Supporter

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

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

I cannot say for sure why it is happening. It may depend on different factors. Based on my experience, the 3rd party plugins might affect this behavior.

Sometimes, the problem actually comes from specific third-party plugins calling the flush_rewrite_rules(true) function too often. This causes WordPress to overwrite .htaccess.

I suggest you test the following workaround: https://wpml.org/errata/htaccess-is-rewritten-with-language-folder/

October 16, 2023 at 1:53 pm #14585649

oliverR-34

Thank you! Will try and test and get back to you soon.

October 16, 2023 at 1:55 pm #14585657

Andrey
Supporter

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

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

Sure, take your time. Thank you.

October 19, 2023 at 11:29 am #14614331

oliverR-34

No, it does not help. Any other ideas? Maybe some senior from your team may have some ideas also? Thank you!

October 19, 2023 at 12:52 pm #14614929

Andrey
Supporter

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

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

I would try the following then:

1) We have just released the new WPML 4.6.7. I suggest to update.

You can check the latest released versions under "My Account -> Downloads" on this site. Instructions to update can be found here: http://wpml.org/faq/install-wpml/

2) Check if shop page slug pood match the slug translation in WooCommerce → WooCommerce Multilingual & Multicurrency → Store URLs. Attached is the screen as an example.

3) Maybe create a new shop page and assign it as a shop page.

4) If there is still the issue, you need to find a way to test this without all plugins except WPML, WooCommerce, and WooCommerce Multilingual & Multicurrency to see the results. If you have a staging site, that is perfect. Or make a full backup and take a quick test.

WooCommerce-Multilingual-Multicurrency-‹-WCML-Plugin-GUI-—-WordPress(1).png