Have you tried using mod rewrite in other application using the same server and it works?
Try this code, put it on a new .htaccess
# It will prevent directory listing or file access using http
Order deny,allow
Deny from all
#File types for which we make an exception.
<Files ~ "\.(gif|jpg|jpeg|png)$">
Order allow,deny
Allow from all
</Files>
Put the file on a new folder on your root dir. Add test.txt file and test.jpg file in that folder.
Try accessing both files using your web browser. If your server support htaccess, it should allow the jpg file to be accessed, but not the txt file.
Report back to us.
Anyway, there might be a better way to check this kind of thing, but I have no experience in it. So hopefully this will help out.