This thread is resolved. Here is a description of the problem and solution.
Problem:
If you're experiencing server errors on your site that make it very slow and often go away when you reload the page, we have identified a potential solution.
Solution:
First, you might be facing an issue that requires adding specific code to your theme's functions file to correct rewrite rules:
1. Using FTP, navigate to `/wp-content/themes/your-theme`.
2. Open the `functions.php` file for editing.
3. Add the following code and then save the changes:
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; }
For more details, please refer to the documentation: https://wpml.org/faq/why-is-htaccess-getting-overwritten-with-the-language-folder-on-my-wpml-website/.
Additionally, to identify the exact cause of the errors, enable debugging in your site.
To enable it, open your wp-config.php file and look for define('WP_DEBUG', false);. Change it to:
define('WP_DEBUG', true);
To enable the error logging to a file on the server, you need to add yet one more similar line:
define( 'WP_DEBUG_LOG', true );
The errors will be saved to a debug.log file inside the /wp-content/directory.
https://wpml.org/documentation/support/debugging-wpml/
If this solution does not apply to your case, or if it seems outdated, 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 23 replies, has 0 voices.
Last updated by 1 week, 1 day ago.
Assisted by: Andrey.