Page 2 of 2 FirstFirst 12
Results 11 to 19 of 19

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

  1. #11
    Aquarezz's Avatar
    Aquarezz is offline Master Net Builder
    Join Date
    Dec 2008
    Location
    Belgium
    Posts
    3,853
    Blog Entries
    4
    Thanks
    683
    Thanked 591 Times in 463 Posts
    Quote Originally Posted by Soulzripper View Post
    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..
    Yep, I'm using this on my proxies:
    Code:
    <? include("/home/*cPanel Username here*/public_html/file.php"); ?>
    So when I update file.php in the public_html it auto-updates every website (this code is thanks to dtkguy if I remember well )

    I'm using this for:
    Proxified page (a banner that is currently there, if I sell that banner I can update it with one single click on all proxies)

    Topsites links (a new toplist -> just add it to that file and add all sites to that list

    Google Adsense (If I want to try new formats, I can change it via one file)


    And it's all working pretty well for me
    |Nico Lawsons

  2. Thanked by:

    Soulzripper (2 May, 2009)

  3. #12
    Soulzripper's Avatar
    Soulzripper is offline Net Builder
    Join Date
    Jan 2009
    Location
    Bangalore
    Posts
    202
    Thanks
    15
    Thanked 9 Times in 8 Posts
    Yo thanx man
    Indian & International webmasters are welcome !!!

    http://NpXp.com

  4. #13
    GrilledChicked's Avatar
    GrilledChicked is offline Newbie Net Builder
    Join Date
    Mar 2009
    Posts
    288
    Thanks
    17
    Thanked 9 Times in 9 Posts
    Quote Originally Posted by Aquarezz View Post
    Yep, I'm using this on my proxies:
    Code:
    <? include("/home/*cPanel Username here*/public_html/file.php"); ?>
    So when I update file.php in the public_html it auto-updates every website (this code is thanks to dtkguy if I remember well )

    I'm using this for:
    Proxified page (a banner that is currently there, if I sell that banner I can update it with one single click on all proxies)

    Topsites links (a new toplist -> just add it to that file and add all sites to that list

    Google Adsense (If I want to try new formats, I can change it via one file)


    And it's all working pretty well for me
    I'm lost

    Could you give some steps to achieve this plz?

    Where do i put that code?
    Proxy Sites - Submit your proxy now!

  5. #14
    Aquarezz's Avatar
    Aquarezz is offline Master Net Builder
    Join Date
    Dec 2008
    Location
    Belgium
    Posts
    3,853
    Blog Entries
    4
    Thanks
    683
    Thanked 591 Times in 463 Posts
    Quote Originally Posted by GrilledChicked View Post
    I'm lost

    Could you give some steps to achieve this plz?

    Where do i put that code?
    I put that code before the last </div>

    In the 'topsites.php' file, just add all backlinks to the topsites You know how this works right (if you want an image on a page):
    Code:
    <img src="images/logo.png" />
    Well it's the same, you link to a file in the public_html map, it isn't an image, so you have the use the code at the top of this page

    If you have more questions feel free to ask
    |Nico Lawsons

  6. #15
    oxuro's Avatar
    oxuro is offline Extreme Developement going on..
    Join Date
    Sep 2009
    Location
    Greece
    Posts
    121
    Thanks
    3
    Thanked 13 Times in 11 Posts
    Hey guys , i am trying to install this "mod" on my proxies but i seem that i do something wrong and it doesn't wonna work

    this is the code that i am adding on the top of my index.php

    <?php

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

    $gi = geoip_open('/GeoIP/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.google.com'); //enter a url or page on your site

    ?>
    and i get this error
    Fatal error: Cannot redeclare geoip_country_code_by_name() in /home/blablabla/public_html/GeoIP/geoip.inc on line 347


    Help meh! What am i doing wrong

  7. #16
    ruben's Avatar
    ruben is offline Net Builder
    Join Date
    Oct 2009
    Posts
    378
    Blog Entries
    1
    Thanks
    44
    Thanked 57 Times in 48 Posts
    Quote Originally Posted by oxuro View Post
    Hey guys , i am trying to install this "mod" on my proxies but i seem that i do something wrong and it doesn't wonna work

    this is the code that i am adding on the top of my index.php

    and i get this error


    Help meh! What am i doing wrong
    You get a lot of unexpected errors while trying to install this, what do you use phproxy or glype?

  8. #17
    dtkguy's Avatar
    dtkguy is offline Still Learnin'
    Join Date
    Dec 2008
    Posts
    391
    Thanks
    7
    Thanked 164 Times in 108 Posts
    Would this be at o2 proxy? I had the same errors there too.

    1st try changing the include('/GeoIP/geoip.inc'); to include_once('/GeoIP/geoip.inc'); That should take care of it.

    If not read on..since the code we are using doesn't actually use that function it is safe to comment them out in geoip.inc . There are actually 2 functions needed comment out. These are them :
    PHP Code:
    /*
    function geoip_country_code_by_name($gi, $name) {
      $country_id = geoip_country_id_by_name($gi,$name);
      if ($country_id !== false) {
            return $gi->GEOIP_COUNTRY_CODES[$country_id];
      }
      return false;
    }

    function geoip_country_name_by_name($gi, $name) {
      $country_id = geoip_country_id_by_name($gi,$name);
      if ($country_id !== false) {
            return $gi->GEOIP_COUNTRY_NAMES[$country_id];
      }
      return false;
    }
    */ 

  9. #18
    ruben's Avatar
    ruben is offline Net Builder
    Join Date
    Oct 2009
    Posts
    378
    Blog Entries
    1
    Thanks
    44
    Thanked 57 Times in 48 Posts
    Quote Originally Posted by dtkguy View Post
    Would this be at o2 proxy? I had the same errors there too.

    1st try changing the include('/GeoIP/geoip.inc'); to include_once('/GeoIP/geoip.inc'); That should take care of it.

    If not read on..since the code we are using doesn't actually use that function it is safe to comment them out in geoip.inc . There are actually 2 functions needed comment out. These are them :
    PHP Code:
    /*
    function geoip_country_code_by_name($gi, $name) {
      $country_id = geoip_country_id_by_name($gi,$name);
      if ($country_id !== false) {
            return $gi->GEOIP_COUNTRY_CODES[$country_id];
      }
      return false;
    }

    function geoip_country_name_by_name($gi, $name) {
      $country_id = geoip_country_id_by_name($gi,$name);
      if ($country_id !== false) {
            return $gi->GEOIP_COUNTRY_NAMES[$country_id];
      }
      return false;
    }
    */ 
    Here you go:
    http://www.netbuilders.org/web-proxies/block-countries-geoip-lite-easiest-way-10730.html

  10. #19
    oxuro's Avatar
    oxuro is offline Extreme Developement going on..
    Join Date
    Sep 2009
    Location
    Greece
    Posts
    121
    Thanks
    3
    Thanked 13 Times in 11 Posts
    @ruben tried to installed it on a glype proxy :P

    @dtkguy yea i am using o2proxyhost atm. After your bug fix that you posted , i did the changes and now it works like a charm

    Thank you both mates for your help

Page 2 of 2 FirstFirst 12

Similar Threads

  1. Block A Country
    By Will.Spencer in forum Managing
    Replies: 12
    Last Post: 30 October, 2010, 04:07 AM
  2. Redirect specific country
    By borce in forum Monetizing
    Replies: 3
    Last Post: 10 October, 2010, 00:06 AM
  3. possible host one site in two country ?
    By SonnyCooL in forum Web Hosting
    Replies: 4
    Last Post: 12 May, 2010, 12:26 PM
  4. [Free] FREE PHP GeoIP Country Redirect
    By crivion in forum Scripts
    Replies: 2
    Last Post: 15 March, 2010, 19:56 PM
  5. Block all together or Redirect - Cant decide
    By ProxySites.ca in forum Web Proxies
    Replies: 6
    Last Post: 11 October, 2009, 21: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
  •