Ce sujet est résolu. Voici une description du problème et de la solution.
Problem:
If you're experiencing a 500 error when opening content in the English language and have noticed errors related to the WPML plugin in your logs, particularly after translating content with WPML and using the "Different languages in directories" URL format.
Solution:
We recommend taking the following steps to resolve the issue:
1. Ensure you are using the latest version of your theme and other plugins to your site including WPML.
2. Add the following code to your theme's functions.php file to fix potential rewrite rule issues:
add_filter('mod_rewrite_rules', 'fix_rewritebase'); function fix_rewritebase($rules){ $home_root = parse_url(home_url()); if ( isset( $home_root['path'] ) ) { $home_root = trailingslashit($home_root['path']); } else { $home_root = '/'; } $wpml_root = parse_url(get_option('home')); if ( isset( $wpml_root['path'] ) ) { $wpml_root = trailingslashit($wpml_root['path']); } else { $wpml_root = '/'; } $rules = str_replace("RewriteBase $home_root", "RewriteBase $wpml_root", $rules); $rules = str_replace("RewriteRule . $home_root", "RewriteRule . $wpml_root", $rules); return $rules; }
3. Re-save your permalinks from Settings >> Permalinks by clicking the Save Changes button.
4. Clear all types of caches, including site/server cache, plugin cache, CDN cache, and browser cache.
For more details on .htaccess issues with WPML, please refer to this documentation: https://wpml.org/faq/why-is-htaccess-getting-overwritten-with-the-language-folder-on-my-wpml-website/
If the solution provided here is not relevant to your case, either because it's outdated or not applicable, 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 the issue persists, please do not hesitate to open a new support ticket with us.
Il s'agit du forum d'assistance technique de WPML, le plug-in multilingue pour WordPress.
Il est accessible à tous, toutefois seuls les clients de WPML peuvent y publier leurs messages. L'équipe du WPML répond sur le forum 6 jours par semaine, 22 heures par jour.
Aucun de nos assistants n'est disponible aujourd'hui sur le forum French. Veuillez créer un ticket, et nous nous le traiterons dès notre prochaine connexion. Merci de votre compréhension.
Ce sujet contient 4 réponses, a 2 voix.
Dernière mise à jour par Noman Il y a 5 mois et 2 semaines.
Assisté par: Noman.
Ce ticket est maintenant fermé. Si vous êtes un client de WPML et que vous avez besoin d'aide, veuillez ouvrir un nouveau ticket d'assistance