How to country ban using htaccess?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • chowda
    Confirmed User
    • Jun 2003
    • 9527

    #1

    How to country ban using htaccess?

    I need to ban hong kong and china hotlinkers.. since they are no use to me.

    so how do i redirect these contries specifically?
    Someone finds you...
    2007

    PS: Nationalnet is the best host I've ever had. And i tried alot of them.
  • Fabuleux
    Confirmed User
    • May 2003
    • 2543

    #2
    I don't think that's really simple. You need some program that can lookup the IP number in a little database to see which country the visitor is coming from.

    Maybe this is something for you:
    http://nibbi.net/scripts/ip-filter.php
    Last edited by Fabuleux; 03-25-2005, 07:13 AM.

    Comment

    • HarlotCash Dyker
      Confirmed User
      • Sep 2003
      • 1828

      #3
      hing like this?

      RewriteEngine On
      RewriteCond %{REMOTE_HOST} ^.*\.hk$ [OR]
      RewriteCond %{HTTP:Accept-Language} ^hk.*$
      RewriteRule .* http://www.page-to-send-them-to.com/index.htm [R]
      Deny from .cn
      Last edited by HarlotCash Dyker; 03-25-2005, 07:17 AM.
      !!!Harlot Cash<<>>Harlot Cash<<>>Harlot Cash<<>>Harlot Cash!!!

      Comment

      • Fabuleux
        Confirmed User
        • May 2003
        • 2543

        #4
        Redirecting on browser language can be good since I don't think a lot a Chineese people use an English browser.

        Comment

        • mrthumbs
          salad tossing sig guy
          • Apr 2002
          • 11702

          #5
          yup only way to ban them is determining location on browser language.. depending on the country you are planning to ban that only 50-90% accuracy (90% chinese for example and 50% if you plan to ban a european country).

          Other than that only geo-ip can help you.

          Comment

          • chowda
            Confirmed User
            • Jun 2003
            • 9527

            #6
            Originally posted by Fabuleux
            I don't think that's really simple. You need some program that can lookup the IP number in a little database to see which country the visitor is coming from.

            Maybe this is something for you:
            http://nibbi.net/scripts/ip-filter.php
            well i do have their ip addresses right now, and i dont mind the hotlinking, but not from hk and china.
            actually lookin at my stats, i have their whole ip block. :D
            Someone finds you...
            2007

            PS: Nationalnet is the best host I've ever had. And i tried alot of them.

            Comment

            • Fuckin Bill
              Confirmed User
              • Feb 2003
              • 1020

              #7
              If you have the IPblock, you can just use a deny statement in the .htaccess. Just put in the first 2 numbers or first 3 of the ip.


              <Limit GET POST>
              order Allow,Deny
              Deny from XXX.XXX.
              Allow from all
              </Limit>

              That'll drop the traffic completely and won't use the extra resources needed my mod-rewrite to redirect them or check for language or any of that stuff.

              Comment

              • tre sandman
                Confirmed User
                • Mar 2005
                • 113

                #8
                http://www.tgpsoftware.com/features.html

                Comment

                Working...