mod_rewrite’s RewriteCond directive supports a filesize comparison like this:
RewriteCond TestString -s
This verifies that TestString is a file with non-zero size. This patch adds the ability to compare the file’s size with an arbitrary value:
RewriteCond TestString -s>1000
RewriteCond TestString -s=1024
RewriteCond TestString -s<5000
The patch was created against Apache 2.2.8 but will probably apply against the 2.0 series as well.