Can I make Apache drop a connection when matching a URL?

Solution 1:

Is it really worth the trouble? As long as your site doesn't have any vulnerabilities that the bots are looking for, it's just another entry in your error log. Unless it's actually causing excessive load on the server, it's pretty much a non-issue.

If you are running something popular in the sense of wide-spread usage and vulnerability exploits and you aren't confident about staying up to date on security fixes, then, yes, mod_security might be a layer of safety. Note, however, that mod_security will break stuff with any useful rules unless it's tuned properly for your site(s).

I don't think mod_security will give you a tar-pit or null response like you are asking for. If you want to tell some(one|thing) to piss off, give them a 403 Forbidden on any specific URL's you are especially worried about by setting up the appropriate rewrite rules.