We have experienced a large number of bad requests from several ip addresses that causes a lot of 404 errors and considerably slow down our page load. Our environment does not allow us to use htaccess file. So I am trying to block them in httpd.conf. Here is the directive that I tried various syntax to block 216.244.75.* These ips are blocked but they continue to cause error 403. Though the performance of our website improved a great deal. Is there a better way to block these IP's completely?
<Directory "/home/chariya/webapps/betatest">
SetEnvIF X-Forwarded-For "216.244.75" blocked
SetEnvIF X-Forwarded-For "^216\.244\.75\.*" blocked
SetEnvIF X-Forwarded-For "216.244.75.226" blocked
SetEnvIF X-Forwarded-For "216.244.75.162" blocked
<RequireAll>
Require all granted
Require not env blocked
</RequireAll>
</Directory>