Problem: If you're experiencing issues with activating WPML on a subsite in a WordPress multisite installation with subdirectory configuration on top of Nginx, and encountering an error stating that the WordPress REST API must be enabled, this might be due to Nginx rewrite rules not properly handling the language-prefixed REST URL. Solution: We recommend adjusting your Nginx rewrite rules to correctly rewrite URLs for WPML's REST API checks. Here's an example of how you can modify your rewrite rules:
rewrite /wp-admin$ $scheme://$host$uri/ permanent;
# one or two prefixes before wp-* (e.g. /masse/wp-json or /masse/en/wp-json)
rewrite ^(/[^/]+)?(/[^/]+)?(/wp-.*)$ $3 last;
rewrite ^(/[^/]+)?(/[^/]+)?(/.*\.php)$ $3 last;
After updating the rules, remember to reload the server, clear all caches, and resave permalinks in WordPress. This solution might be outdated or not applicable to your specific case. 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 the problem persists, please open a new support ticket at WPML support forum.