The basic WordPress htaccess is this:
# BEGIN WordPress
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress
From this I deduced the following:
A request only gets to WordPress index.php and subsequently the WordPress routing if there is not file (-f) or directory (-d) that matches the request.
In the WordPress HTML output the source attribute of the media files are URLs which directly correspond to filepaths.
So when the web browser requests media files, they are handled entirely by the webserver (Apache) and WordPress (and its PHP filesystem I/O routines) is not involved in serving the media files as I see it.
So the case insensitivity can be achieved entirely by the proper .htaccess directives. And there happens to be a solution in Apache exactly for the purpose of case insensitive URLs which is mod_speling:
## Case insensitive file serving
### mod_speling
# attempts to correct mistaken URLs by ignoring capitalization,
# or attempting to correct various minor misspellings.
### Enable the spelling module
CheckSpelling on
### Limit the action of the speling module to case corrections - I solely need this.
CheckCaseOnly on
### Also match files with differing file name extensions - I explicitly don't want this. Want to avoid unintentionally serving image.gif instead of image.png
CheckBasenameMatch off
I put this into the .htaccess of the subdomain which serves my Media Library. Alternatively you may also put this into the default Media Library location at /wp-content/uploads/ to limit mod_speling to that directory and its subdirectories.
Only problem: Does (yet) not work. My webhost seems to have something in the global httpd config which forbids CheckSpelling On. Already asked them. When I got a solution I will inform you here.