This thread is resolved. Here is a description of the problem and solution.
Problem:
You are experiencing a 500 error on your site after a .htaccess file is automatically created when you make changes in Settings --> General. This file seems to be created in an incorrect location.
Solution:
The creation of the .htaccess file is a normal behavior when updating permalinks settings, as it is essential for the correct functioning of permalinks on your site. However, if the .htaccess file is causing issues, it might be due to it being overwritten incorrectly. We recommend checking out this documentation on why the .htaccess file might get overwritten and how to handle it: Why is .htaccess getting overwritten with the language folder on my WPML website?
Please ensure to back up your database before making any changes.
If this solution does not apply to your case, or if it seems outdated, we highly recommend checking related known issues at https://wpml.org/known-issues/, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If issues persist, please open a new support ticket.
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 is split from https://wpml.org/forums/topic/site-url-how-to-automatically-direct-to-en-or-fr-based-on-user-locale-detection/