For some reason Loco or other plugin is randomly, on a daily basis adds language folder to our htaccess file causing frontend to break in a redirect loop
Here is an example of what I expect to see in htaccess:
BEGIN WordPress
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]
END WordPress
Here is what I actually get:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* -
[E=HTTP_AUTHORIZATION :% <НТ:Authorization}]
RewriteBase /en/
RewriteRule ^index. php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /en/index.php [L]
END WordPressOnce I had similar issue with WPML and it was never addressed properly, they just suggested some snippet that blocks adding language folder – https://wpml.org/faq/why-is-htaccess-getting-overwritten-with-the-language-folder-on-my-wpml-website/
What could be a better solution here?
