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.

.htaccess Geo Country / IP Redirect Script

Discussion in 'Apache' started by adioking, Oct 5, 2006.

  1. #1
    Hi everybody,

    Being in the online gambling industry, I've been forced to "deny" all United States players from access to my website. However, I don't want to use a typical deny US .htaccess script. I want to redirect my US visitors to a special disclaimer page where they accept special TAC and can then move on to other sections of my website.

    I was thinking of putting something into my .htaccess such as the following, but it doesn't seem to be working (since I'm trying to block myself from access as I'm in the US)

    Do I need to have an <IfModule> tag around this at all in my .htaccess file? Is there something that I'm missing here that isn't letting this work?

    Any help would be greatly appreciated. I've been looking for Geo Redirect software too, and none of what is offered out there seems to work.

    Dan
    SEMrush
     
    adioking, Oct 5, 2006 IP
    SEMrush
  2. adioking

    adioking Peon

    Messages:
    22
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #2
    I've also been advised that this may have an adverse affect on my SEO and be determined as cloaking. I'm not sure what I can do in order to keep my US visitors from seeing the 'illegal' content on my website while allowing non-us visitors to see the 'legal' content on my site. What i mean is that a new law made it illegal for us citizens to make banking transactions to these online gambling sites, but it is perfectly legal for any other non-us citizens.

    Anybody?
     
    adioking, Oct 5, 2006 IP
  3. aeiouy

    aeiouy Peon

    Messages:
    2,877
    Likes Received:
    275
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Geo-targetting is not considered illegal cloaking by Google.

    At least according to Matt Cutts it is not.

    There are some geo-targeting scripts / databases you can implement in php fairly easily and you can do whatever you want with the visitor. Including just having it pause briefly explaining why they can not access the content and then redirect them to another site.
     
    aeiouy, Oct 5, 2006 IP
  4. adioking

    adioking Peon

    Messages:
    22
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    Well since Matt Cutts works on the Google spam side of things, I'll trust what he has to say.

    I did find a nice free Geo IP targetter, but it seems that it is not working when I try to import the MySQL file into my new database. I've never really been very good with MySQL and databases before, so I'm not sure where to go from here.

    I did get the software from http://webnet77.com/scripts/geo-ip/index.html and the database from http://software77.net/cgi-bin/ip-country/geo-ip.pl

    Could somebody please offer a helping hand? I'm not just at this community to "take" as I do offer many of my own personal suggestions as well, mostly SEO related.

    Thanks!
    Dan
     
    adioking, Oct 7, 2006 IP
  5. nevetS

    nevetS Evolving Dragon

    Messages:
    2,544
    Likes Received:
    211
    Best Answers:
    0
    Trophy Points:
    135
    #5
    Just from glancing at it, your .htaccess looks fine to me - but it does require that you are setting those environment variables appropriately. Or perhaps, the environment variables are returning USA or U.S. which ould not trigger the rewrite.

    Probably best to check in the support forums for your particular GEOIP apache module.
     
    nevetS, Oct 7, 2006 IP
  6. Pat Gael

    Pat Gael Banned

    Messages:
    1,332
    Likes Received:
    68
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Pat Gael, Oct 7, 2006 IP
  7. Scripto

    Scripto Peon

    Messages:
    2
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    I have been using power redirect for a while and it seems that it increased my pagerank :D
    It has a free geo database update twice a week.
    http://www.12scripts.com/scripts.php?scripts.id=2
     
    Scripto, Feb 21, 2007 IP
  8. WebGeek182

    WebGeek182 Active Member

    Messages:
    510
    Likes Received:
    28
    Best Answers:
    0
    Trophy Points:
    95
    #8
    The appropriate GEOIP module may not be installed on your server, or it may depend on how you have PHP running on Apache.
     
    WebGeek182, Feb 22, 2007 IP
  9. fadetoblack22

    fadetoblack22 Well-Known Member

    Messages:
    2,332
    Likes Received:
    52
    Best Answers:
    0
    Trophy Points:
    160
    #9
    I want to do a smilar thing. When my site loads I want a message to come up so that users can continue to the main site or see a specific page.
     
    fadetoblack22, Oct 17, 2009 IP
  10. redhits

    redhits Notable Member

    Messages:
    3,023
    Likes Received:
    277
    Best Answers:
    0
    Trophy Points:
    255
    #10
    You may also modify the php code... just tell them it's illegal to play if they are from US, and after they press the OK button , just let them play...

    make a big button like "it must be something wrong, i am not from US, let me play" lol
     
    redhits, Oct 19, 2009 IP
  11. JamminJ

    JamminJ Active Member

    Messages:
    141
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    65
    #11
    JamminJ, Apr 7, 2011 IP