How to block IP addresses by country?

Discussion in 'other security issues & news' started by Durad, Nov 10, 2006.

Thread Status:
Not open for further replies.
  1. Durad

    Durad Registered Member

    Joined:
    Aug 13, 2005
    Posts:
    591
    Location:
    Canada
    Is there a way to block all countires except Canada?

    I have local forum and once I did mistake and posted my forum on some other forum to let users vote about its look. This was my big mistake.

    A lot of spammers are comming from that site.

    Is there a way to block all IP's that does not belong to Canada?
     
  2. TNT

    TNT Registered Member

    Joined:
    Sep 4, 2005
    Posts:
    948
    There is a way, but it has to be done "manually": what you can do is take a list of all known Internet Service Providers in Canada, and put a regular expression in the server side code (PHP for instance) that displays only a blank page unless the regular expression matches one of the IPs of Canada.
     
Loading...
Thread Status:
Not open for further replies.