1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

is it possible to block/redirect visitors by ISP?

Discussion in 'General Scripting Chat' started by theconfidenceman, May 19, 2011.

  1. theconfidenceman

    theconfidenceman Regular Member

    Joined:
    Feb 24, 2008
    Messages:
    262
    Likes Received:
    57
    Location:
    New York
    Home Page:
    I'm looking to redirect visitors from a particular ISP to a different web page. It seems the IP is dynamic, as well as a portion of the ISP name eg new york city company name or west virginia company name.

    I want them off the site and not able to do biz with me at all.
    is it possible to send them to an entirely different domain? if so, how would I do it?
     
  2. fatboy

    fatboy Elite Member

    Joined:
    Aug 13, 2008
    Messages:
    1,618
    Likes Received:
    3,227
    Occupation:
    Retired
    Location:
    Old Peoples Home
    You could but its not easy - you either have to find all ip ranges used by those ISPs or do a reverse lookup on the IP addresses to see if there is something common in the name.

    For example, if your IP is 78.23.22.12 then the reverse lookup would be: 78-23-22-12.access.telenet.be.

    You could write a bit of code at the top of your index page to check the reverse lookup for certain words (eg telenet) and then redirect based on that.

    Think thats what you are after!
     
  3. xpwizard

    xpwizard Junior Member

    Joined:
    Nov 6, 2010
    Messages:
    198
    Likes Received:
    122
  4. other_henry

    other_henry Junior Member

    Joined:
    Jun 1, 2011
    Messages:
    107
    Likes Received:
    19
    Occupation:
    Freelance coder, server guy
    Location:
    US
    Do a whois on the IP of the ISP, that should show you the IPs they are assigned.

    Then block or redirect those IPs in htaccess (for apache)