Yes. A .htaccess file is one way that works for blocking http requests and is the easiest and often the only option if you are on a hosted account.

However iptables/netfilter is best, but is far more complex to configure and is not an option for many (most?). It was beyond my talents before doing a LOT of reading.