This question is not the same as How to Block Spam Referrers like darodar.com from Accessing Website? as that question hightlight on how to block a specific referer.
This question is about to block any request with Referer set and give them a 404 error.