Block IP Address of The Spammer Using .htaccess to Block Spam Comments
If you check your spam comments you can see that most of the spam comments are from a specific IP address or IP Addresses. Comment spamming is common and the webmasters should be prepared to block spam comments. Read the artilce: How to Avoid Spam Comment on My Site?
If you find your blog is targeted by spammers from some specific IP address/ addresses you can block them from accessing you blog. This can be done b adding few entries in the .htaccess file. If you are not familiar with .htaccess we have plenty of articles on .htacess.
Block IP of The Spammer Using .htaccess to Avoid Spam Comments
If you are using Apache HTTP server for hosting your blog then you can use .htaccess files for access control. .htaccess is a file containing one or more configuration directives, is placed in a particular document directory, and the directives apply to that directory, and all sub-directories thereof.
Blocking an IP address using the .htaccess method is not a proper way to deal with comment spam. It is considered as a bad policy to block clients based solely on their IP address. But if you are constantly receiving spam from the IP you can do it.
“Deny from” directive will block service to a specific IP address, domain name or block:
Deny from 127.0.0.1
Alternatively you can use the <Limit> directive along with HTTP methods to deny access to a particular IP address
1 2 3 4 5
<Limit GET HEAD POST> order allow,deny deny from 127.0.0.1 allow from all </Limit>
To block a group if IP addresses you can use like
1 2 3 4 5
<Limit GET HEAD POST> order allow,deny deny from 127.0.0.1/19 allow from all </Limit>
Generally the syntax is
<Limit method [method] … > … </Limit>
Please note that the IP address given above (127.0.0.1) is for illustration purpose only. 127.0.0.1 normally represents local host and is not a public IP address.https://www.globinch.com/block-ip-address-of-the-spammer-using-htaccess-to-block-spam-comments/Technology & Toolsblock ip address,block spam comments,block spammers,how to a website,how-to guidesIf you check your spam comments you can see that most of the spam comments are from a specific IP address or IP Addresses. Comment spamming is common and the webmasters should be prepared to block spam comments. Read the artilce: How to Avoid Spam Comment on My Site?...Binu GeorgeBinu Georgebinugeorgep@gmail.comAdministratorBinu George , the author of Globinch.com, is a technology blogger from India and a software solution architect by profession.globinch.com - Website Optimization, Blog, Tech Tools