We have files stored in a directory \"uploads/downloads\" which are accessed through a php file in the manner of https://www.example.com/request_file.php?file=123. That PHP
Try something like this:
RewriteEngine On RewriteCond %{HTTP_REFERER} !request_file.php RewriteRule ^uploads/downloads/ - [L,R=404]