Reputation: 101
<Limit GET HEAD POST>
order deny,allow
deny from 81.52.168.0/23
deny from 188.138.10.163/32
deny from 188.138.78.129/32
allow from all
</Limit>
I found some code but I not conform. How do I use this to block my website in Pakistan? I don’t want to open my site in this country, so can anyone tell me what I am doing?
Upvotes: 0
Views: 1413
Reputation: 1
Put in .htaccess
file and hide t:
<Limit GET HEAD POST>
order deny,
allow deny from 72.229.28.185
allow from all
</Limit>
Upvotes: 0
Reputation: 1324
There is a site, countryipblocks.net, that will generate the htaccess file for you. For the country, obviously you want to select Pakistan, then you'll want to select the ".htaccess Deny" option, then it will generate the file you need.
Upvotes: 1
Reputation: 121799
TCP/IP doesn't work like that: you can't really identify, much less "block countries", just by IP address.
Even if you tried to hack an .htaccess file, the list of IP addresses would be prohibitively large ... and you'd still miss many.
SUGGESTION: Read this article for several possible alternatives for you:
http://www.sitepoint.com/how-to-block-entire-countries-from-accessing-website/
This is another good article:
https://www.raymond.cc/blog/easily-block-visitors-from-a-country-using-htaccess/
Upvotes: 1