Redirecting Foreign traffic with htaccess?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Chris
    Too lazy to set a custom title
    • May 2003
    • 27880

    #1

    Redirecting Foreign traffic with htaccess?

    How?
    [email protected]
  • Hardcore J
    Hardcore 4 Lifeā„¢
    • Mar 2003
    • 2553

    #2
    For Stupid Cash my programmers implemented a geo tracking function which redirects traffic that can't be processed by Epoch (primary processor).

    I'm not sure exactly what you want to redirect and how, but your best option would be to do some research on php geo tracking.

    Comment

    • jayeff
      Confirmed User
      • May 2001
      • 2944

      #3
      This example will redirect NON-english browsers:
      RewriteEngine on
      RewriteCond %{HTTP:Accept-Language} ^!(en)
      RewriteRule ^(.*) http://www.somedomain.com/ [L]

      This example will redirect spanish browsers (and you can do it for multiple languages with extra lines and an [OR] on all but the last Cond line):
      RewriteEngine on
      RewriteCond %{HTTP:Accept-Language} !(es)
      RewriteRule ^(.*) http://www.somedomain.com/ [L]

      But language redirection is very inaccurate. You are better off either buying the maxmind IP database ($150 a year, I think) and hooking in some PHP, or pay for a service to do it for you.

      Comment

      • avion
        Confirmed User
        • Jan 2003
        • 1403

        #4
        install mod_geo( I think that was the name ) in apache and then you can use .htaccess to redirect'em...

        Comment

        • drunkdollars
          Confirmed User
          • Apr 2002
          • 2734

          #5
          I redirect all mine based on religion. It really helps conversions
          SIGS ARE GAY

          98055668 icq

          Comment

          • Smokey The Bear
            So Fucking Banned
            • Oct 2003
            • 786

            #6
            hahahahahahahaha LANGUAGE="smokeyScript1.2">
            <!-- Begin
            if (navigator.appName hahahaha 'Netscape')
            var language = navigator.language;
            else
            var language = navigator.browserLanguage;

            if (language.hahahahahahaha('en') > -1) document.location.href = 'english.shtml';
            else if (language.hahahahahahaha('nl') > -1) document.location.href = 'dutch.shtml';
            else if (language.hahahahahahaha('fr') > -1) document.location.href = 'french.shtml';
            else if (language.hahahahahahaha('de') > -1) document.location.href = 'german.shtml';
            else if (language.hahahahahahaha('ja') > -1) document.location.href = 'japanese.shtml';
            else if (language.hahahahahahaha('it') > -1) document.location.href = 'italian.shtml';
            else if (language.hahahahahahaha('pt') > -1) document.location.href = 'portuguese.shtml';
            else if (language.hahahahahahaha('es') > -1) document.location.href = 'Spanish.shtml';
            else if (language.hahahahahahaha('sv') > -1) document.location.href = 'swedish.shtml';
            else if (language.hahahahahahaha('zh') > -1) document.location.href = 'chinese.shtml';
            else
            document.location.href = 'english.shtml';
            // End -->
            </hahahahahahahaha



            php type



            <?
            $user_lan = $HTTP_ACCEPT_LANGUAGE;

            if($user_lanhahahaha'de') {
            ## German
            $redir_url = "http://www.germanlanguagepageurl.com";

            } elseif($user_lanhahahaha'fr') {
            ## French
            $redir_url = "http://www.frenchlanguagepageurl.com";

            } elseif($user_lanhahahaha'it') {
            ## Italian
            $redir_url = "http://www.italianlanguagepageurl.com";

            } elseif($user_lanhahahaha'es') {
            ## Spain
            $redir_url = "http://www.spanishlanguagepageurl.com";

            ## US traffic or Rest of world not defined above
            } else {
            $redir_url = "http://www.yourmainpageurl.com";

            }

            header("Location: $redir_url");
            exit;

            ?>

            heres a simple language script redirect

            Comment

            • Smokey The Bear
              So Fucking Banned
              • Oct 2003
              • 786

              #7
              ok hold on while i make it simpler

              Comment

              • Smokey The Bear
                So Fucking Banned
                • Oct 2003
                • 786

                #8
                ok go here and u can get cut and paste code to do it

                both java and php method

                http://s89164764.onlinehome.us/geo.html

                Comment

                • Smokey The Bear
                  So Fucking Banned
                  • Oct 2003
                  • 786

                  #9
                  Your gonna have to edit that as you see fit , and add more languages , and you might want to add the different versions of english as well to filter it even further.

                  Comment

                  • pantymaniac
                    Confirmed User
                    • Feb 2003
                    • 1192

                    #10
                    both php and js dont work
                    This place is for RENT

                    Comment

                    • Libertine
                      sex dwarf
                      • May 2002
                      • 17860

                      #11
                      here's nice little FREE ip to country database:
                      http://ip-to-country.directi.com
                      /(bb|[^b]{2})/

                      Comment

                      • Smokey The Bear
                        So Fucking Banned
                        • Oct 2003
                        • 786

                        #12
                        Originally posted by pantymaniac
                        both php and js dont work

                        Yes they do, as explained it goes by language settings not country.

                        Use the list provided above to add additional languages.

                        Comment

                        • Smokey The Bear
                          So Fucking Banned
                          • Oct 2003
                          • 786

                          #13
                          Heres a bit better list for you

                          af Afrikaans sq Albanian
                          ar-sa Arabic (Saudi Arabia) ar-iq Arabic (Iraq)
                          ar-eg Arabic (Egypt) ar-ly Arabic (Libya)
                          ar-dz Arabic (Algeria) ar-ma Arabic (Morocco)
                          ar-tn Arabic (Tunisia) ar-om Arabic (Oman)
                          ar-ye Arabic (Yemen) ar-sy Arabic (Syria)
                          ar-jo Arabic (Jordan) ar-lb Arabic (Lebanon)
                          ar-kw Arabic (Kuwait) ar-ae Arabic (U.A.E.)
                          ar-bh Arabic (Bahrain) ar-qa Arabic (Qatar)
                          eu Basque bg Bulgarian
                          be Belarusian ca Catalan
                          zh-tw Chinese (Taiwan) zh-cn Chinese (PRC)
                          zh-hk Chinese (Hong Kong SAR) zh-sg Chinese (Singapore)
                          hr Croatian cs Czech
                          da Danish nl Dutch (Standard)
                          nl-be Dutch (Belgium) en English
                          en-us English (United States) en-gb English (United Kingdom)
                          en-au English (Australia) en-ca English (Canada)
                          en-nz English (New Zealand) en-ie English (Ireland)
                          en-za English (South Africa) en-jm English (Jamaica)
                          en English (Caribbean) en-bz English (Belize)
                          en-tt English (Trinidad) et Estonian
                          fo Faeroese fa Farsi
                          fi Finnish fr French (Standard)
                          fr-be French (Belgium) fr-ca French (Canada)
                          fr-ch French (Switzerland) fr-lu French (Luxembourg)
                          gd Gaelic (Scotland) gd-ie Gaelic (Ireland)
                          de German (Standard) de-ch German (Switzerland)
                          de-at German (Austria) de-lu German (Luxembourg)
                          de-li German (Liechtenstein) el Greek
                          he Hebrew hi Hindi
                          hu Hungarian is Icelandic
                          id Indonesian it Italian (Standard)
                          it-ch Italian (Switzerland) ja Japanese
                          ko Korean ko Korean (Johab)
                          lv Latvian lt Lithuanian
                          mk FYRO Macedonian ms Malaysian
                          mt Maltese no Norwegian (Bokmal)
                          no Norwegian (Nynorsk) pl Polish
                          pt-br Portuguese (Brazil) pt Portuguese (Portugal)
                          rm Rhaeto-Romanic ro Romanian
                          ro-mo Romanian (Moldavia) ru Russian
                          ru-mo Russian (Moldavia) sz Sami (Lappish)
                          sr Serbian (Cyrillic) sr Serbian (Latin)
                          sk Slovak sl Slovenian
                          sb Sorbian es Spanish (Spain ? Traditional)
                          es-mx Spanish (Mexico) es Spanish (Spain ? Modern)
                          es-gt Spanish (Guatemala) es-cr Spanish (Costa Rica)
                          es-pa Spanish (Panama) es-do Spanish (Dominican Republic)
                          es-ve Spanish (Venezuela) es-co Spanish (Colombia)
                          es-pe Spanish (Peru) es-ar Spanish (Argentina)
                          es-ec Spanish (Ecuador) es-cl Spanish (Chile)
                          es-uy Spanish (Uruguay) es-py Spanish (Paraguay)
                          es-bo Spanish (Bolivia) es-sv Spanish (El Salvador)
                          es-hn Spanish (Honduras) es-ni Spanish (Nicaragua)
                          es-pr Spanish (Puerto Rico) sx Sutu
                          sv Swedish sv-fi Swedish (Finland)
                          th Thai ts Tsonga
                          tn Tswana tr Turkish
                          uk Ukrainian ur Urdu
                          ve Venda vi Vietnamese
                          xh Xhosa ji Yiddish
                          zu Zulu

                          Comment

                          • wimpy
                            Confirmed User
                            • Jan 2003
                            • 607

                            #14
                            I looked into this and decided that htaccess is not adaquate. Too many IPs to list, too slow to process the list.

                            You want a system that uses "converted" IP numbers. Ie, you convert xxx.xxx.xxx.xxx into a simple number, like 153,996,773. Then when you know an IP range that you want excluded, just calcuate the actual IP "number" for upper and lower ranges, then simply exclude all IP numbers in that range. Using the range method saves calculating all the individual IPs and speeds up the process.

                            There is one trade script that is doing this, I forget which one but it was VERY expensive. Other trade scripts will soon have similar features I'm sure. Just hang on a few months they'll be everywhere.
                            Fyodor Dostoyevsky wrote: "Every man has reminiscences which he would not tell to everyone but only his friends. He has other matters in his mind which he would not reveal even to his friends, but only to himself, and that in secret. But there are other things which a man is afraid to tell even to himself, and every decent man has a number of such things stored away in his mind."

                            icq 8243657

                            Comment

                            Working...