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.

Sun Mon Tue Wed Thu Fri Sat
9:00 – 15:00 9:00 – 15:00 9:00 – 15:00 9:00 – 15:00 9:00 – 15:00 - -
- - - - - - -

Supporter timezone: Asia/Yerevan (GMT+04:00)

This topic contains 1 reply, has 0 voices.

Last updated by Christopher Amirian 1 month, 3 weeks ago.

Assisted by: Christopher Amirian.

Author Posts
January 25, 2025 at 7:31 am #16633212

aleksandreK

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?

January 26, 2025 at 12:51 pm #16635145

Christopher Amirian
Supporter

Languages: English (English )

Timezone: Asia/Yerevan (GMT+04:00)

Hi,

Welcome to WPML support.

It seems that you are experiencing an issue related to the documentation below:

https://wpml.org/ru/faq/why-is-htaccess-getting-overwritten-with-the-language-folder-on-my-wpml-website/

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.