Change htaccess to redirect to index.php in subfolder

Try something like the following at the top of the root .htaccess file, before the existing WordPress directives (before the # BEGIN WordPress comment marker):

RewriteCond $2 !^(index\.php)?$
RewriteRule ^(subfolder)/(.+) /$1/index.php?path=$2 [L]

The RewriteCond directive is to ensure that it doesn’t try to rewrite requests for index.php itself (or the directory). A request for /subfolder/ only will be served by /subfolder/index.php without the path URL parameter (by mod_dir).

Otherwise, all other requests to that subfolder (whether they map to files, directories or nothing at all) are passed to /subfolder/index.php in the query string.