Page 3 of 8 FirstFirst 12345 ... LastLast
Results 21 to 30 of 78

Thread: How can i redirect bad traffic?

  1. #21
    vectro's Avatar
    vectro is offline I Like Stuff
    Join Date
    Dec 2008
    Location
    U.S.A.
    Posts
    625
    Thanks
    192
    Thanked 100 Times in 79 Posts
    Quote Originally Posted by zeolshah View Post
    Man, really thanks for that. Let me ask you; I have unlimited bandwidth, so do I really wanna use this? any harm from these countries than bandwidth misuse? Just my doubt

    Thanks in advance
    Some countries leach access to proxies but convert low as far as clicks and revenue are concerned. Also, beware of "unlimited" hosting. There is really no such thing. Every host has limits and this is false advertising. You're still best off blocking certain countries if you operate proxies.

  2. #22
    zeolshah's Avatar
    zeolshah is offline ZilZil Proxy
    Join Date
    Jan 2010
    Posts
    76
    Thanks
    1
    Thanked 1 Time in 1 Post
    Quote Originally Posted by vectro View Post
    Some countries leach access to proxies but convert low as far as clicks and revenue are concerned. Also, beware of "unlimited" hosting. There is really no such thing. Every host has limits and this is false advertising. You're still best off blocking certain countries if you operate proxies.
    Ok buddy... thanks for that...

  3. #23
    Adydsauza is offline Unknown Net Builder
    Join Date
    Mar 2010
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    You have to need to set up an internal DNS server and set up forward lookup zones for the domains that you wish to redirect along with records for the host names of the destination host.

  4. #24
    _Chris_ is offline Newbie Net Builder
    Join Date
    Apr 2011
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi all, would love to set this up, how do you set up the code in .HTaccess file, to only allow USA, Canada and Mexico, and redirect all other IP's to another website please?

  5. #25
    Mike-XS's Avatar
    Mike-XS is offline XeroAgent
    Join Date
    Sep 2009
    Location
    OZ
    Posts
    209
    Thanks
    30
    Thanked 109 Times in 71 Posts
    Quote Originally Posted by _Chris_ View Post
    Hi all, would love to set this up, how do you set up the code in .HTaccess file, to only allow USA, Canada and Mexico, and redirect all other IP's to another website please?
    Chris have a look at the post by dtkguy, in this very topic on page 2:
    How can i redirect bad traffic?

    The country codes would be:
    $allowedCountry = array('US','CA','MX');
    A list of the GEO IP country codes used by Maxmind can be found here:
    MaxMind - ISO 3166 Country Codes

  6. #26
    _Chris_ is offline Newbie Net Builder
    Join Date
    Apr 2011
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks Mike, any ideas on how the precise code in the .htaccess would look, using geoip to only allow USA, Canada and Mexico, BUT redirecting all other countries to another website?

    Any help much appreciated.

    Chris

  7. #27
    Mike-XS's Avatar
    Mike-XS is offline XeroAgent
    Join Date
    Sep 2009
    Location
    OZ
    Posts
    209
    Thanks
    30
    Thanked 109 Times in 71 Posts
    Sorry I was thinking of the PHP method in my reply above, not the .htaccess.

    Are you using the geoip.dat file or does your server have the apache GEO IP module installed ? There are a few different examples here - MaxMind - GeoIP Apache API. I just modified the first example a little to redirect all traffic that's not from USA, Canada or Mexico to google.

    Code:
    RewriteEngine on
    RewriteCond %{ENV:GEOIP_COUNTRY_CODE} !^(US|CA|MX)$
    RewriteRule ^(.*)$ http://www.google.com$1 [L]
    That works for me on Vectro's server with .htaccess

    If you're going to be using the .dat file you'll probably also need to set the location to the geoip.dat file above those rules.

  8. #28
    _Chris_ is offline Newbie Net Builder
    Join Date
    Apr 2011
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts
    No worries Mike - I'm just grateful for the help As a matter of interest, I don't mind going the PHP route, but where would the php code go? In a certain page?

  9. #29
    Mike-XS's Avatar
    Mike-XS is offline XeroAgent
    Join Date
    Sep 2009
    Location
    OZ
    Posts
    209
    Thanks
    30
    Thanked 109 Times in 71 Posts
    Usually the PHP code should be at the very top of your index.php file, just after the opening PHP tag.

  10. #30
    _Chris_ is offline Newbie Net Builder
    Join Date
    Apr 2011
    Posts
    17
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Ah, I see, so that would only be for the page being viewed, but I would want this for the whole website, so probably best to stick with the .htaccess file, so on that assumption, in the .htaccess file would be :
    Code:
    RewriteEngine on
    RewriteCond %{ENV:GEOIP_COUNTRY_CODE} !^(US|CA|MX)$
    RewriteRule ^(.*)$ http://www.google.com$1 [L]


    isn't that code in the .htaccess a bit sparse? My hosts don't have that file, so where do I get it and more importanly, where do I put it please?

Page 3 of 8 FirstFirst 12345 ... 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
  •