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 7 replies, has 2 voices.

Last updated by Dražen Duvnjak 4 months, 3 weeks ago.

Assigned support staff: Dražen Duvnjak.

Author Posts
July 13, 2021 at 6:04 pm #9189159

Kristof

Everytime we enable or disable the plugin, we get a 500 error. The error disappears when we resave the Permalinks.

July 14, 2021 at 7:22 am #9192091

Dražen Duvnjak
Supporter

Languages: English (English )

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

Hello!

Welcome to WPML Support. I'll do my best to help you solve this issue.

This reminds me of an issue that happens with specific 3rd party plugins and WPML.

In certain cases, the .htacess may get overwritten with the language folder. However, this issue is not caused by WPML.

The problem actually comes from certain third-party plugins calling flush_rewrite_rules(true) function too often. This causes WordPress to overwrite .htaccess. However, in some cases, this happens so often, sometimes even on every page request, that it’s called while browsing the front-end in another language.

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.

Can you please go to next link and try suggested workaround:

- https://wpml.org/errata/htaccess-is-rewritten-with-language-folder/

Let me know how it goes.

Thanks,
Drazen

July 14, 2021 at 8:46 am #9192817

Kristof

Hi,

This is the default htaccess that does not throw an error

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

I have been testing all plugins in combination with WPML and noticed the behaviour with these plugins
Simple Custom CSS and JS
Elementor Free (Pro is not an issue)

As we enable/disable those plugins, the htaccess becomes this and we see a 500 error.

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /nl/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /nl/index.php [L]
</IfModule>

We see this entry in the apache error log
[Wed Jul 14 08:44:42.282485 2021] [core:error] [pid 671:tid 140659692033792] [client 78.23.211.240:24812] AH00124: Request exceeded the limit of 10 internal redirects due to probable configuration error. Use 'LimitInternalRecursion' to increase the limit if necessary. Use 'LogLevel debug' to get a backtrace., referer: hidden link

July 14, 2021 at 9:47 am #9194077

Dražen Duvnjak
Supporter

Languages: English (English )

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

Hello,

thanks for getting back and taking time to test. I don't believe it is Elementor, since if it was we would be having many clients reporting this. While Simple Custom CSS and JS could be causing it in a way I described in the previous reply.

Can you please check again and try theesuggested workaround from the errata page shared in my previous reply and let me know if this helps you.

Thanks,
Drazen

July 14, 2021 at 11:46 am #9195141

Kristof

Hi Drazen,

I am sorry I had not already applied your workaround, as that page clearly states that it is a temporary workaround and that was early 2018. One would expect this to be fixed in core code already.

I can confirm that both Simple Custom CSS/JS and Elementor Free cause the issue. If we disable one and disable/enable the other one, the 500 error happens every time.

Luckily your code snippet fixes this, but does this mean we have to keep this snippet for eternity enabled? I like workarounds, not not indefinite, it should be fixed in core code.

July 14, 2021 at 2:13 pm #9196727

Dražen Duvnjak
Supporter

Languages: English (English )

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

Hello Kristof,

thanks for getting back.

Yes, it is from 2018 and it was fixed from our side, but as you can in the page it says it should be fixed also in 3rd party plugin code causing it:

The proper fix is for the third-party plugin to flush the rewrite rules only once. There are many different cases depending on the plugin you are using, so if you need more help please report in our support and we’ll help you.

For Simple Custom CSS and JS plugin, I suggest you report to them and share mentioned errata with them, so they can understand the issue and correct the code from their side.

Since you mentioned it happens also with Elementor only, which is not expected I suggest we check on this further and see what goes wrong with Elementor and WPML.

To troubleshoot this issue without affecting your site I created a test server for you in Cloudways (https://wpml.org/hosting-partner/cloudways/).

If it is OK with you, we can migrate your content there to further debugging without any risk on your end.

To do the migration please follow these simple steps from my next private reply.

Thanks,
Drazen

July 15, 2021 at 12:49 pm #9209497

Dražen Duvnjak
Supporter

Languages: English (English )

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

Hello,

thanks for getting back.

I was able to check and see the issue.

I have now shared this issue and ticket with our 2nd tier support, to check and advise further.

I will update you soon.

Thanks,
Drazen

July 16, 2021 at 6:40 am #9214223

Dražen Duvnjak
Supporter

Languages: English (English )

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

Hello,

thanks for your patience.

Our 2nd tier checked the issue, it seems it happens only with Simple Custom CSS and JS plugin and the issue should be fixed from the plugin side/code as suggested in our errata.

We did the necessary changes back in 2018, and there is not much more we can do from our side in this case.

The proper fix is for the third-party plugin to flush the rewrite rules only once. This would result in better performance of plugins in question because flushing rewrite rules is a server-expensive operation and extra care should be taken.

The best we can do is suggest you to report this issue to the plugin author and ask them to adjust their code to flush the rewrite rules only once.

- https://wordpress.org/support/plugin/custom-css-js/

If they need our help they can join our Go Global compatibility program and we will be glad to help them out.

- https://wpml.org/documentation/support/go-global-program/

I hope you understand our side here.

I hope I was helpful. Don't hesitate to ask if you find any problem along the way, we'll gladly help you.

Kind regards,
Drazen