Page 1 of 2 12 LastLast
Results 1 to 10 of 19

Thread: How to Block and Redirect a country to a different site ?

  1. #1

    Wink How to Block and Redirect a country to a different site ?

    Well, The title says it all..

    I am really kinda lost with this issue..

    Can someone guide me step by step how to go about this..
    Indian & International webmasters are welcome !!!

    http://NpXp.com

  2. #2
    Join Date
    Dec 2008
    Location
    Redmond, Oregon
    Posts
    828

  3. #3

  4. #4
    See, I have a shard hosting.. And I don't got direct access to server..

    Is there a way I can tmzhosting to do it for me ?
    Or some other way prolly I can do it myself ??
    Indian & International webmasters are welcome !!!

    http://NpXp.com

  5. #5
    Quote Originally Posted by Soulzripper View Post
    See, I have a shard hosting.. And I don't got direct access to server..

    Is there a way I can tmzhosting to do it for me ?
    Or some other way prolly I can do it myself ??
    Most of the other posts referenced work with .htaccess - you don't need direct access to the server to edit .htaccess.

  6. #6
    Using Glype? Put this at the top of index.php
    PHP Code:
    <?php

    include('geoip.inc'); //this file must exist in your directory

    $gi geoip_open('/your/path/to/GeoIP.dat',GEOIP_STANDARD);

    // get the ip of the visitor
    $addr getenv('REMOTE_ADDR');
    // translate his ip to a country code
    $country geoip_country_code_by_addr($gi$addr);
    // close the geo database
    geoip_close($gi);

    $badcountry = array('CN','KW','RU','IR','NG','PK','TR','SA');

    // redirect them if they suck
    if(in_array($country$badcountry))
    header('Location: http://www.SOMEDOMAIN.com'); //enter a url or page on your site

    ?>
    Download the geoip.inc and geoip.dat from MaxMind
    geoip.inc > Index of /download/geoip/api/php
    geoip.dat (click the download link for GeoLite Country binary format) > MaxMind - GeoLite Country | Open Source IP Address to Country Database

    This will work at TMZ, I've used it.

  7. #7
    Join Date
    Dec 2008
    Location
    Redmond, Oregon
    Posts
    828
    http://www.netbuilders.org/web-proxi...html#post18475 this one uses javascript to accomplish it so you wouldnt need to worry if geoip mod is enabled on your server. Then another method just posted by dtkguy

    Reverse IP Check ಠ_ಠ Proxy Sites
    <?php if ($youask == 'stupid question') { echo ('stupid answer'); } ?>

  8. #8
    Hmm Thanks..

    Well I have 27 sites in my network..

    DO I have to edit all of the index.php

    Or can it be done more easily ?
    Indian & International webmasters are welcome !!!

    http://NpXp.com

  9. #9
    There may be an easier way, I dunno.

    But if it's Glype, the index.php will be the exact same for every site you have, so just edit it once, and then copy it to all the others.

  10. #10
    Do you guys know that "single file trick" ?

    Like you update 1 file and it gets updated on all other add on domains ?

    Aquarezz has used it I guess..
    Indian & International webmasters are welcome !!!

    http://NpXp.com

Page 1 of 2 12 LastLast

Similar Threads

  1. Block A Country
    By Will.Spencer in forum Managing
    Replies: 12
    Last Post: 30 October, 2010, 03:07 AM
  2. Redirect specific country
    By borce in forum Monetizing
    Replies: 3
    Last Post: 9 October, 2010, 23:06 PM
  3. possible host one site in two country ?
    By SonnyCooL in forum Web Hosting
    Replies: 4
    Last Post: 12 May, 2010, 11:26 AM
  4. [Free] FREE PHP GeoIP Country Redirect
    By crivion in forum Scripts
    Replies: 2
    Last Post: 15 March, 2010, 18:56 PM
  5. Block all together or Redirect - Cant decide
    By ProxySites.ca in forum Web Proxies
    Replies: 6
    Last Post: 11 October, 2009, 20:36 PM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •