Google exactly that and you will find lots of examples of how to create a HTTP Handler to give a 403 error to any request coming from an IP that you want to block
A simple way <% Dim sBlockedIP sBlockedIP = Request.ServerVariables("REMOTE_ADDR") 'check if the IP is the one that is blocked If sBlockedIP = "32.454.42.12" Then 'if IP address is banned then redirect to no_access.asp Response.Redirect "no_access.asp" End If %> Code (markup):
do you mean block an IP from a specific country? Otherwise you can block an IP regardless of the country that it belongs to.
Hi Everybody Maintaining your own web presence is inevitably associated with potential external risks such as attack of malevolent users. The good news here is that you can easily recognize such malicious visitors, by checking the IP addresses that they are making a connection from.
i am agree with gmybft but are you sure to do that because it can decrease your traffic other wise you can use single IP blocking scripts i think its better
Good ide gmybft , and script is fine if banned ip is from a pc and not from a site. you know an ip adress kan be also shared with may be more than 100 different sites url. and think if your site banned this ip then banned all of them. is it true?.
Are you talking about blocking an entire country's IP block? Or just a list? If you have a small list you can always list them in a DB and compare the web site visitor to the DB values. If you want to block entire country you can try using geolocation databases.