Hey, Is there anyway to block countries Ip's from accessing my site? I have the IP list from http://www.maxmind.com/app/geoip_country but i dont know how to block those ips i want. I want to block Ip's from countries such as Iran which are visiting my site www.cgiproxy.co.uk alot and since its a proxy it can use alot of bandwidth which i dont want people from non english countries using up as they are less likely to click on ads. If you know how to do this please say so thanks. GP Ive tried the thing at www.fixingtheweb.com but since im on shared hosting i dont have access to a cmd prompt to actually do this.
I would do it like this : (assuming you use php) - stuff the list in a db - remove all the ip's which you will allow. (saves some space and will make queries faster) - then on every page request check the $_SERVER['REMOTE_ADDR'] variable against your list in the db. If a match is found serve up an access denied message or a 404 or whatever. Use the "begin_num" and "end_num" fields for range checking. See this explanation to make up the number for an IP. The query would be something like this : select * from ip_list where begin_num<=ip_to_check and end_num>=ip_to_check; Code (markup): pretty easy if you know some php.
i dont know some php lol, well very basic and ive never used server remote addr. Would you make something like this for me if i linked to your site 6000 fonts?
sgthayes got it right, that is if you know a little bit of PHP. Very nice/fast proxy. Why is it a co.uk if it's based in the US?
it just is, i like the .co.uk domain and all the other domains were taken, plus us hosting is cheaper.
Hi all, I'm not working with .php but would like to just block my online internet player from non-US visitors. So when the click on the link to my player they get an error page or are forwarded to another page of mine. thanks for any help!
Is it hosted under apache? If it is, check out this post. It's a very simple way to block countries. Just know that when I looked at blocking China on some of my email servers I ended up blocking all of Australia because their IPs come from some of the same blocks. http://forums.digitalpoint.com/showthread.php?t=240060&highlight=block+iran
If you know all ip ranges for certain country then is easy to block it.Through database or .htaccess. Check ip ranges by http://www.ipaddresslocation.org/ to get all ranges for any country in the world.
Hi, Another, maybe faster solution to block access for certain countries is to use the service provided by blockacountry.com. On this website you can select which countries you want to block for your website. Next the website will generate a .htaccess document for you which you need to upload to the server. That is all there is to do. Enjoy Wildcard
Hi all, I made a file with the name of .htaccess , I want know that, in which folder I should upload this file in my website. after uploading this file should i run anything to run this file? Can anyone describe fully how to go through this .htaccess process just frm after making this file... tell me exactly what to do step by step. I have already uploaded it on my website through ftp in the folder name wwwroot/ so now it is like : ftp://mydomainname.com/wwwroot/.htaccess but still it is not working , I hope so.. because my website is accessible still now from the IP range I have denied in the .htaccess file. is it right? after this what to do ? Please reply, Waiting for kind help. Thanks for any help.