I had problems with PhpMyAdmin in a subdirectory of TYPO3.
After long time I found this block in a .htaccess
-file in a directory above causing malfunction of one file of phpmyadmin:
# UTF-8 encoding
AddDefaultCharset utf-8
<IfModule mod_mime.c>
AddCharset utf-8 .atom .css .js .json .manifest .rdf .rss .vtt .webapp .webmanifest .xml
</IfModule>
Reason for this was that there exists a file phpmyadmin.css.php
which is triggered by the rule.
After changing the rule like following PhpMyAdmin is working normally:
# UTF-8 encoding
AddDefaultCharset utf-8
<IfModule mod_mime.c>
AddCharset utf-8 .atom .js .json .manifest .rdf .rss .vtt .webapp .webmanifest .xml
#####
## This block is for the file phpmyadmin.css.php, where the suffix css is not the last one.
## @see https://httpd.apache.org/docs/current/mod/mod_mime.html#multipleext
#####
<FilesMatch "[^.]+\.css$">
AddCharset utf-8 .css
</FilesMatch>
</IfModule>
The condition <FilesMatch "[^.]+\.css$">
is only triggered if the suffix css
is at the end of the filename.
So my case is not about rewriting but about a resembling problem where rewriting seemed being the solution first for me.