1. Advertising
    y u no do it?

    Advertising (learn more)

    Advertise virtually anything here, with CPM banner ads, CPM email ads and CPC contextual links. You can target relevant areas of the site and show ads based on geographical location of the user if you wish.

    Starts at just $1 per CPM or $0.10 per CPC.

Can someone help me with this .htaccess file

Discussion in 'Site & Server Administration' started by TheSyndicate, Feb 12, 2017.

  1. #1
    I am trying to redirect all others countries than sweden and Thailand

    # Redirect
    Redirect 301 / www.hello.com
    
    # RewriteEngine on
    RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^(TH|SE)$
    RewriteRule ^(.*)$ http://www.google.com$1 [L]
    PHP:

     
    TheSyndicate, Feb 12, 2017 IP
  2. areebmajeed

    areebmajeed Active Member

    Messages:
    19
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    58
    #2
    Have you installed the GeoIP library properly? If I were in your position, I'd do programmatically with PHP. I've put the sample code below.

    http://pastebin.com/iCVM1cAD
     
    areebmajeed, Feb 24, 2017 IP
  3. TheSyndicate

    TheSyndicate Prominent Member

    Messages:
    5,410
    Likes Received:
    289
    Best Answers:
    0
    Trophy Points:
    365
    #3
    You control each website from WHM
     
    TheSyndicate, Mar 2, 2017 IP
  4. ThePHPMaster

    ThePHPMaster Well-Known Member

    Messages:
    737
    Likes Received:
    52
    Best Answers:
    33
    Trophy Points:
    150
    #4
    Make sure that you have the Apache module setup correct:
    
    echo '<pre>'; print_r($_SERVER);
    
    Code (markup):
    You should be able to see all the GEOIP variables, if not it is not setup correctly if it is make sure the variable name matches.

    If all is good, how are you testing it (via proxy?) access the above print_r test page while on the proxy to make sure it is picking the country right.
     
    ThePHPMaster, Mar 5, 2017 IP