To block access to specific file types using .htaccess, you can use the `FilesMatch` directive along with the `Deny` directive. Here’s how you can do it:
<FilesMatch "\.(pdf|doc|xls)$"> Deny from all </FilesMatch>
In this example:
1. `<FilesMatch>` specifies a block of directives that will apply to files that match the specified pattern.
2. `”^(pdf|doc|xls)$”` is a regular expression pattern that matches file extensions `.pdf`, `.doc`, and `.xls`. You can add or remove file extensions as needed.
3. `Deny from all` denies access to files that match the specified pattern.