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.

This topic contains 3 replies, has 2 voices.

Last updated by Dražen Duvnjak 1 year, 2 months ago.

Assigned support staff: Dražen Duvnjak.

Author Posts
August 2, 2020 at 9:11 am #6721377

siimH-2

Hi there!

It seems that after adding a new language (danish) to our website, the WPML changes regularly and almost every day the htaccess file so that the error 500 appears on the website. It does it since at least 4-5 weeks. At the beginning it made changes every morning, suddenly it started to change the file every evening. Sometimes there's about 3 day pause when no changes take place. But the latter is only temporary.

The htaccess should be so:

# BEGIN WordPress
# The directives (lines) between `BEGIN WordPress` and `END WordPress` are
# dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

But after the change takes place it is so:

# BEGIN WordPress
# The directives (lines) between `BEGIN WordPress` and `END WordPress` are
# dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /de/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /de/index.php [L]
</IfModule>

# END WordPress

As we have many language on the website, then its different every time after the change takes place. Sometimes it will change it to /sv/, sometimes /fi/ or /en/ etc.

Greetings

August 3, 2020 at 1:52 pm #6726793

Dražen Duvnjak
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hello,

This sounds to me like a known issue when the problem actually comes from certain third-party plugins calling flush_rewrite_rules(true) function too often. When this happens, WPML goes ahead and adds the language folder to home_url as usual. This, however, results with an incorrect RewriteBase in .htaccess and ends up breaking the front-end.

Please check next link and try suggested workaround:
- https://wpml.org/errata/htaccess-is-rewritten-with-language-folder/

If you still having issues please share more information:

1) Have you installed any new plugins recently?

2) Have you noticed any specific steps when and how this issue happens?

3) Do you think you would be able to reproduce this issue on a copy of your website, so I can check it further?

We need to be able to reproduce the issue in order to investigate it and see what goes wrong.

Please let me know how it goes.

Thanks,
Drazen

August 6, 2020 at 9:58 am #6748181

siimH-2

Hi there again and many thanks for the reply.

We have added the code to the functions.php file and we have to just wait, whether it makes changes or not. But coming back to your questions, then:

1) we have only 3 ideas - a) after adding a new language ; b) after testing the Yith Multistep Checkout (this is the only plugin that we have installed recently, but as it did not fit for us, we did delete the plugin..; c) some updates (we update our plugins on regular basis)

2) Only thing that we have noticed that all most at the same time there is also a change in the WP Super Cache (it shows that it has changed something in the folders in FTP)

3) Unfortunately not, I'm not able to do it.

Greetings and many thanks!

August 7, 2020 at 6:30 am #6754123

Dražen Duvnjak
Supporter

Languages: English (English )

Timezone: Europe/Zagreb (GMT+02:00)

Hello,

thanks for the feedback.

In order for us to be able to investigate and provide more information/fix the issue, we need to be able to check and see the issue. That being the case there is not much else I can do for now. I suggest you monitor the situation and get back to us if the issue happens again.

We will be glad to help. 🙂

If it happens again please check with hosting if they have any log what action/function/plugin caused the change to the httaccess file.

Please let me know if there is anything else I can do for you.

Thanks,
Drazen