1. Order Allow,Deny
  2. Deny from all
  3. <FilesMatch "^[^.]+\.(?:[Jj][Pp][Ee]?[Gg]|[Pp][Nn][Gg]|[Gg][Ii][Ff]|[Pp][Dd][Ff])$">
  4. Allow from all
  5. </FilesMatch>
  6.  
  7. or:
  8.  
  9. Order Allow,Deny
  10. Deny from all
  11. <FilesMatch "^[^.]+\.(?i:jpe?g|png|gif|pdf)$">
  12. Allow from all
  13. </FilesMatch>