Top Hosting Forum

WebHosting Reviews Forum


How to block IP countries to access certain website

General Webmaster Discussion @ Top Hosting Forum
Hosting Forum Description
General Webmaster Discussion at Top Hosting Forum, Welcome

How to block IP countries to access certain website

Postby hostingforum » Tue Oct 09, 2012 12:00 pm

Hi there, my forum got spammed by indian people and it was hopeless no captcha helped, no antispam questions.

So the solution is this, blocking whole countries by adding whole IP blocks into .htaccess file.

Go there: http://ipinfodb.com/ip_country_block.php OR https://www.countryipblocks.net/country_selection.php
and there you can select if you want to geenrate pure IPs (simple list) or allow or denny list for .htaccess file. Or format for iptables linux firewall.

I have selected htaccess deny format and selected countries to block, i have choosen: Bangladesh, Botswana, India, Pakistan, Thailand, Vietnam, China

//Edit: This country list is probably better (forum, guestbook spam): # Chile, China, HongKong, Hungary, Pakistan, Russia, Thailand, Ukraine, Vietnam

#COUNTRY_BLOCK_START - Bangladesh, Botswana, India, Pakistan, Thailand, Vietnam, China
# http://ipinfodb.com/ip_country_block.php#blocklist
<Limit GET HEAD POST>
order allow,deny
deny from 27.131.12.0/22
deny from 27.147.128.0/17
deny from 49.0.32.0/19
...................
allow from all
</Limit>
#COUNTRY_BLOCK_END


So i pasted this code into my .htaccess file (located on your website folder, same location like yoursite.com/index.php , so you create yoursite.com/.htaccess
And paste generated data + save



Ad: There You can have your forum site-wide banner/text ad for $19 monthly. Contact admin


User avatar
hostingforum
Site Admin
 
Posts: 625
Joined: Fri May 20, 2011 7:58 pm
Location: Czech Republic

Re: How to block IP countries to access certain website

Postby Bryan54 » Thu Oct 11, 2012 6:07 am

Hello,
i am a newbie,i would like to know what exactly is the effect of being spammed?Sorry for the question and thanks in advance for your answer.


Bryan54
 
Posts: 4
Joined: Thu Sep 13, 2012 9:13 am

Re: How to block IP countries to access certain website

Postby hostingforum » Thu Oct 11, 2012 8:39 am

Thank You for asking. Result of spam is that forum looses its value. There is many low value nothing saying posts or they say something that already been said before. If you read such posts you end up loosing your time, then you dont want to use forum which is not usefull..

Most spammers aim is to promote some websites more than talk and share knowledge. I will delete all accounts and posts (soon or later) which are duplicate, not useffull and ones i feel are made to mainly promote signature or advertise.


User avatar
hostingforum
Site Admin
 
Posts: 625
Joined: Fri May 20, 2011 7:58 pm
Location: Czech Republic


Return to General Webmaster Talk

Who is online

Users browsing this forum: No registered users and 0 guests


cron