Background of the issue:
I am experiencing an issue with loading multiple language versions on my site hidden link. The URL structure breaks, and I need to make .htaccess flush all the time. I found a snippet on your blog that helps, but I don't want to use extra code. I would like this to be added to the WPML plugin code as an update so I can delete the snippet. The snippet I am using is: 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; }
Symptoms:
The URL structure breaks when loading multiple language versions, requiring .htaccess to be flushed constantly.
Questions:
Can you add the snippet to the WPML plugin code as an update?
Is there a way to improve the plugin to avoid using extra code?
If so, the correct way is to find out which plugin is overusing the retire flush to cause the problem.
But you can use the snippet suggested in the documentation if needed.
Thanks.
The topic ‘[Closed] WPML loading web issue’ is closed to new replies.
Manage Cookie Consent
We use cookies to optimize our website and services. Your consent allows us to process data such as browsing behavior. Not consenting may affect some features.
Functional
Always active
Required for our website to operate and communicate correctly.
Preferences
The technical storage or access is necessary for the legitimate purpose of storing preferences that are not requested by the subscriber or user.
Statistics
We use these to analyze the statistics of our site. Collected information is completely anonymous.The technical storage or access that is used exclusively for anonymous statistical purposes. Without a subpoena, voluntary compliance on the part of your Internet Service Provider, or additional records from a third party, information stored or retrieved for this purpose alone cannot usually be used to identify you.
Marketing
These cookies track your browsing to provide ads relevant to you.