Page 1 of 8 123 ... LastLast
Results 1 to 10 of 78

Thread: How can i redirect bad traffic?

  1. #1

    How can i redirect bad traffic?

    Hello how can i redirect bad traffic from iran etc. Any one who can share your .htaccess file? Thanks,

  2. #2

  3. #3
    ya, i tried to use block a country, block by ip address, deny access by country but can only block ips no redirect the traffic. How about geoip? Seems that i have to write a small php script for it. So can't redirect people BEFORE they visit the website.

  4. #4
    Looks like we need a FAQ sticky for this question..

    There are various links to different GeoIP guides in the link Aziz posted to what I posted the other day.. At least one should help you set up a working Geoip redirect.

    So can't redirect people BEFORE they visit the website
    I don't think so. Wait till they hit your site then redirect them. It shouldn't take too long to set it all up.

  5. #5
    Hey mates, I'd like to use .htaccess file with GeoIP.dat to redirect bad traffic. But could you tell me what I should do before I put "GeoIPEnable On" in .htaccess file. Or I just got 500 internal server error. THanks.

  6. #6
    Do you have mod_geoip installed? http://www.maxmind.com/app/mod_geoip

    To be able to access geoip through htaccess you'll need the module mod_geoip loaded in apache. Are you in control of your server or is it shared?

    If it's shared you're most likely restricted to just running the pure php module for geoip.

    If it's your own server, you can install the GeoIP C Library and the apache module, mod_geoip to beable to use it however you want.

  7. #7
    I was going to buy the Maxmind geo database, I thought $50 is not bad, the catch was it costs $12/month for updates, so the purchase would cost $194 with a year of updates, I was thinking woah, I'll pass becuase that would drain my whole paypal account.
    Submit new proxies -

  8. #8
    Quote Originally Posted by Keldorn View Post
    I was going to buy the Maxmind geo database, I thought $50 is not bad, the catch was it costs $12/month for updates, so the purchase would cost $194 with a year of updates, I was thinking woah, I'll pass becuase that would drain my whole paypal account.
    Haha yeah, they get you with those updates. The free version is just as good for anything I'm going to use it for. The paid version is good if you need the most accurate data possible (99.8% versus 99.5% of the free) as fast as possible (automated updates weekly versus manual updates monthly).

  9. #9
    Quote Originally Posted by dtkguy View Post
    Haha yeah, they get you with those updates. The free version is just as good for anything I'm going to use it for. The paid version is good if you need the most accurate data possible (99.8% versus 99.5% of the free) as fast as possible (automated updates weekly versus manual updates monthly).
    Well when there is 3,706,650,624 usuable Ip4 IP addresses , even .3% is a big deal.

    3,706,650,624 X by .3% means there might be 11,119,951 IPv4 IP addresses that are not correctly categorized in the database... and its true, even with GeoIP blocking Iran iwth the database I get still 10,000 visits from Iran a month, So Google Analytic is more accurate, Some of the IP blocks from Iran are in that .3% range. The database could also incorrectly categorize someone from United States as from say Iran, so now you blocking United States visitors by accident. lol
    Submit new proxies -

  10. #10
    Ok, i've been using this code but i am not sure if it's working though does it look correct ?

    PHP Code:
    <?php
    // PUT THIS CODE AT THE TOP OF YOUR INDEX.PHP BEFORE ANYTHING ELSE

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

    // Uncomment if querying against GeoIP/Lite City.
    // include('geoip/geoip.inc');

    $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_name_by_addr($gi$addr);
    // close the geo database
    geoip_close($gi);

    $badcountry = array('Iran','Saudi Arabia','China','India','Indonesia','Kuwait','Philippines','Vietnam','Russia','Ukraine','Nigeria');

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

    $averagecountry = array ('Poland','Turkey','Finland','Denmark','Israel','Latvia');

    // redirect them if they suck
    if(in_array($country$averagecountry))
    header('Location: http://webevader.org'); //enter a url or page on your site


    /*

Page 1 of 8 123 ... LastLast

Similar Threads

  1. Non www to www redirect
    By tetrapak in forum Managing
    Replies: 8
    Last Post: 31 May, 2010, 18:19 PM
  2. [WTS] Traffic | Traffic | Traffic | Dont forget to check inside
    By squintoo in forum Services
    Replies: 2
    Last Post: 16 October, 2009, 15:12 PM
  3. 301 redirect all to all
    By Hellas in forum Managing
    Replies: 0
    Last Post: 27 August, 2009, 12:25 PM
  4. How to redirect traffic with CSF?
    By ProxySites.ca in forum Web Hosting
    Replies: 1
    Last Post: 5 August, 2009, 23:47 PM
  5. Non-www. to www. 301 redirect
    By Dr. Stavros in forum Managing
    Replies: 8
    Last Post: 29 July, 2009, 18:51 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
  •