1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Block a City from accessing my Website

Discussion in 'Apache' started by GreatestSwordsman, Dec 10, 2010.

  1. #1
    Hello

    I understand it is possible to block a country from viewing my website using apache, .htaccess.

    I was wondering if it is possible to block everyone from a specific City (namely the city of Flower Mound, in Texas) from accessing my website.

    If that's a no-go, how about blocking all of Texas?
     
    GreatestSwordsman, Dec 10, 2010 IP
  2. underground-stockholm

    underground-stockholm Guest

    Messages:
    53
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    There are GeoIP systems that try to retrieve cities and states for an IP address, like this one:
    http://www.hostip.info/

    The data they retrieve isn't 100% correct though.

    It should be possible to make a Perl script or so that does such a lookup, and then hook that into Apache.
     
    underground-stockholm, Dec 14, 2010 IP
  3. Kerosene

    Kerosene Alpha & Omega™ Staff

    Messages:
    11,366
    Likes Received:
    575
    Best Answers:
    4
    Trophy Points:
    385
    #3
    Kerosene, Dec 14, 2010 IP
  4. lyduong

    lyduong Active Member

    Messages:
    31
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    91
    #4
    great post many thanks
     
    lyduong, Dec 17, 2010 IP