Skip to content Skip to sidebar

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
12:00 – 20:00 12:00 – 20:00 12:00 – 20:00 12:00 – 20:00 12:00 – 20:00 - -
- - - - - - -

Supporter timezone: Asia/Karachi (GMT+05:00)

This topic contains 1 reply, has 2 voices.

Last updated by Noman 1 year, 3 months ago.

Assisted by: Noman.

Author Posts
May 12, 2024 at 12:40 pm #15617768

victorM-52

According to Siteground support out .htaccess is being rewritten by the WPML plugin, please help us find a solution, we have been having this error for the past week.

I will deactivate the plugin for the tests.

Screenshot 2024-05-12 at 8.34.12 AM.png
May 12, 2024 at 3:20 pm #15617908

Noman
WPML Supporter since 06/2016

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

Thank you for contacting WPML Support. Based on the details you provided, it appears that the issue may be related to specific plugins or themes on your site. To address this, could you please follow the below steps and see if this resolves your issue:

1. Please take a backup of your site first for safety reasons.

2. Please add the below code in the functions.php file of your theme:

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. Please re-save the permalinks from the Settings >> Permalinks page by pressing the Save Changes button.

4. Please delete all sorts of caches on your site/server cache if any / plugin cache / CDN cache, clear the browser cache, and then see if it resolves the issue afterward.

5. If the issue persists, please make sure to disable the “Allow translating the login and registration pages” option from WPML >> Settings page and see if this resolves the issue.

Here is a doc for more details:
https://wpml.org/faq/why-is-htaccess-getting-overwritten-with-the-language-folder-on-my-wpml-website/

Please let me know the results,
Thank you

The topic ‘[Closed] WPML is rewriting the .htaccess according to Siteground support’ is closed to new replies.