We have been using an Apache module known as mod_security to help prevent various types of intrusions on the webserver for quite a long time.
One thing that users may not know is that mod_security is very adept at stopping comment spam to content management systems also.
You may implement this mod_security filtering to protect against comment spam by entering a few short lines into your .htaccess file.
## Enable Mod Security ##
SecFilterEngine On
SecFilterScanPOST On
SecFilterDefaultAction “deny,log,status:412″
## Comment Spam Indicators ##
SecFilterSelective “POST_PAYLOAD” “poker-w\.com”
SecFilterSelective “POST_PAYLOAD” “texas-holdem-big\.com”
SecFilterSelective “POST_PAYLOAD” “onlinepoker-i\.com”
The three filter lines above are already implemented server wide (as of this update), you do not need to include those within your .htaccess file. All spaces and periods must be escaped with a backslash as in the above example. This example sends a “412: Precondition Failed” error message, as is appropriate; however, you may change it to something like a “403: Forbidden” error by changing the error code number.
You can also redirect rejected POSTs by using the following example, which in this case redirects to the federal cybercrimes reporting site:
SecFilterSelective “POST_PAYLOAD” “poker-w\.com” “redirect:http://www.cybercrime.gov/reporting.htm”
Regardless of how it appears in your browser the redirection example should appear on ONE line, not split across two lines.