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
    Soulzripper's Avatar
    Soulzripper is offline Net Builder
    Join Date
    Jan 2009
    Location
    Bangalore
    Posts
    202
    Thanks
    15
    Thanked 9 Times in 8 Posts

    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
    Mr.Bill's Avatar
    Mr.Bill is offline One is glad to be of service
    Join Date
    Dec 2008
    Location
    Redmond, Oregon
    Posts
    828
    Blog Entries
    1
    Thanks
    72
    Thanked 350 Times in 182 Posts

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

  3. Thanked by:

    Mike-XS (3 December, 2009)

  4. #3
    Loko's Avatar
    Loko is offline Super Moderator
    Join Date
    Dec 2008
    Location
    Europe
    Posts
    964
    Thanks
    351
    Thanked 347 Times in 241 Posts

  5. #4
    Soulzripper's Avatar
    Soulzripper is offline Net Builder
    Join Date
    Jan 2009
    Location
    Bangalore
    Posts
    202
    Thanks
    15
    Thanked 9 Times in 8 Posts
    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

  6. #5
    Charles's Avatar
    Charles is offline Senior Net Builder
    Join Date
    Dec 2008
    Location
    On the Bike
    Posts
    1,211
    Blog Entries
    5
    Thanks
    311
    Thanked 311 Times in 212 Posts
    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.

  7. #6
    dtkguy's Avatar
    dtkguy is offline Still Learnin'
    Join Date
    Dec 2008
    Posts
    391
    Thanks
    7
    Thanked 164 Times in 108 Posts
    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.

  8. Thanked by:

    Glypus (6 October, 2009), jakki (2 January, 2010)

  9. #7
    Mr.Bill's Avatar
    Mr.Bill is offline One is glad to be of service
    Join Date
    Dec 2008
    Location
    Redmond, Oregon
    Posts
    828
    Blog Entries
    1
    Thanks
    72
    Thanked 350 Times in 182 Posts
    Still getting traffic from Iran?! 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'); } ?>

  10. #8
    Soulzripper's Avatar
    Soulzripper is offline Net Builder
    Join Date
    Jan 2009
    Location
    Bangalore
    Posts
    202
    Thanks
    15
    Thanked 9 Times in 8 Posts
    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

  11. #9
    dtkguy's Avatar
    dtkguy is offline Still Learnin'
    Join Date
    Dec 2008
    Posts
    391
    Thanks
    7
    Thanked 164 Times in 108 Posts
    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.

  12. #10
    Soulzripper's Avatar
    Soulzripper is offline Net Builder
    Join Date
    Jan 2009
    Location
    Bangalore
    Posts
    202
    Thanks
    15
    Thanked 9 Times in 8 Posts
    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
  •