need help in blocking access per country

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Blackrose
    Confirmed User
    • Aug 2001
    • 344

    #1

    need help in blocking access per country

    can you guys help me please? i need to block a couple of countries from accessing my sites. How do i do it with .htaccess? also, where can i find all the possible ip's assigned to a country?

    thanks in advance
    The die is cast...
    The dice are rolled...
    You look like shit...
    I feel like gold
    -- Uh, me?
  • Blackrose
    Confirmed User
    • Aug 2001
    • 344

    #2
    bump for me
    The die is cast...
    The dice are rolled...
    You look like shit...
    I feel like gold
    -- Uh, me?

    Comment

    • okdesign
      ICQ 278367136
      • May 2002
      • 24773

      #3
      that is bad idea!

      Comment

      • Blackrose
        Confirmed User
        • Aug 2001
        • 344

        #4
        why? please explain ... do you want to waste BW on countries where 90%+ of the population doesnt have CC ?
        The die is cast...
        The dice are rolled...
        You look like shit...
        I feel like gold
        -- Uh, me?

        Comment

        • darksoul
          Confirmed User
          • Apr 2002
          • 4997

          #5
          www.maxmind.com
          1337 5y54|)m1n: 157717888
          BM-2cUBw4B2fgiYAfjkE7JvWaJMiUXD96n9tN
          Cambooth

          Comment

          • Lycanthrope
            Confirmed User
            • Jan 2004
            • 4517

            #6
            Aye, get a database from Maxmind. The free one is decent, but the paid versions are obviously better.
            I wouldn't just block them. Redirect them somewhere, (dialer, or AFF or something.) where you might at least have a chance at getting something out of them.

            Simply add:

            GeoIPEnable On
            GeoIPDBFile /path/to/GeoIP.dat

            RewriteEngine on
            RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^XX$
            RewriteRule ^(.*)$ http://www.shitcountry.url [L]

            XX would be replaced by the code for the country in question. If redirecting numerous countries to the same URL don't forget to add [OR] after each RewriteCond statement EXCEPT for the last one. If redirecting numerous countries, each to different locations, you'll need one RewriteCond statement AND RewriteRule for each.

            Comment

            • nojob
              The Original NoJob
              • Feb 2004
              • 3682

              #7
              Originally posted by Lycanthrope
              Aye, get a database from Maxmind. The free one is decent, but the paid versions are obviously better.
              I wouldn't just block them. Redirect them somewhere, (dialer, or AFF or something.) where you might at least have a chance at getting something out of them.

              Simply add:

              GeoIPEnable On
              GeoIPDBFile /path/to/GeoIP.dat

              RewriteEngine on
              RewriteCond %{ENV:GEOIP_COUNTRY_CODE} ^XX$
              RewriteRule ^(.*)$ http://www.shitcountry.url [L]

              XX would be replaced by the code for the country in question. If redirecting numerous countries to the same URL don't forget to add [OR] after each RewriteCond statement EXCEPT for the last one. If redirecting numerous countries, each to different locations, you'll need one RewriteCond statement AND RewriteRule for each.
              Thanks for the post.

              Comment

              • colpanic
                Confirmed User
                • May 2004
                • 1007

                #8
                Hey. List the countries here & maybe we can work something out.

                I've got some uses for foreign adult traffic (European specifically).

                T
                I like ducks.

                Comment

                • Blackrose
                  Confirmed User
                  • Aug 2001
                  • 344

                  #9
                  Lycanthrope big thanks for this one ...
                  The die is cast...
                  The dice are rolled...
                  You look like shit...
                  I feel like gold
                  -- Uh, me?

                  Comment

                  Working...