Whenever I try to edit an exitsing page with VisualEditor I get the error mentioned in the title: "Error contacting the Parsoid/RESTBase server (HTTP 403)".
The wiki has editing restricted for unregistered users, but pages' content is public. MediaWiki's version is 1.35.
The 403 error arose after solving a 404 error by modifying the .htaccess file for the wiki.
I tried the 2 following versions of code for the .htaccess and they both lead to a 403 error:
RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ %{DOCUMENT_ROOT}/index.php RewriteRule rest.php/ /rest.php?%{QUERY_STRING} [L]
and
RewriteEngine On RewriteCond %{REQUEST_URI} !^(static) RewriteCond %{HTTP_USER_AGENT} !^(VisualEditor) RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-f RewriteCond %{DOCUMENT_ROOT}%{REQUEST_URI} !-d RewriteRule ^(.*)$ %{DOCUMENT_ROOT}/index.php [L]