Another H5P error that was showing up on a multisite WP install. I think it’s because this is an older multisite. I didn’t see it on some other multisites where we have H5P.
The error looked something like this in console.
reading-and-writing-lesson-1/:1 Refused to execute script from 'https://whatever.middcreate.net/heritage/files/h5p/cachedassets/c5b1e369da83cc4492098b38274ce28fd9490e08.js' because its MIME type ('text/plain') is not executable, and strict MIME type checking is enabled.
This ends up being another .htaccess fix (remember to set your preferences to see invisible files). This was set on the .htaccess file in the directory that holds the multisite.
The change is per site ID. For a site with the subdirectory ‘heritage’ and the ID of 9, it looks like this.
RewriteCond %{DOCUMENT_ROOT}/wp-content/blogs.dir/9/files/h5p/$1 -f
RewriteRule ^heritage/files/h5p/(.+)$ wp-content/blogs.dir/9/files/h5p/$1 [L]
The RewriteCond rule shown for site ID 9 is particularly helpful for multisite environments where content paths are nested deeply. I was struggling with similar strict MIME type checking errors until I realized I needed to target the specific blogs.dir directory structure rather than the root. This solution clearly explains how to map the subdirectory URL to the correct physical file path for older installs.