htaccess help....

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • klinton
    So Fucking Banned
    • Apr 2003
    • 8766

    #1

    htaccess help....

    I would like to setup redirection via htaccess...redirecting by referer and browser language together....only when surfer is refered by some site and his browser is in some language..then he would be redirected...

    for example.... referer is aaa.com and language is ru ..... so how would htaccess line look like ?

    thanks.....
  • Kiopa_Matt
    Confirmed User
    • Oct 2007
    • 1448

    #2
    Your best bet is using PHP.

    Then GeoIP the addresses using maxmind . com. Free version available.
    xMarkPro -- Ultimate Blog Network Management
    Streamline your marketing operations. Centralize management of domains, pages, Wordpress blogs, sponsors, link codes, media items, sales and traffic statistics, plus more!

    Comment

    • klinton
      So Fucking Banned
      • Apr 2003
      • 8766

      #3
      no possibility to do it in htaccess ?

      Comment

      • Kiopa_Matt
        Confirmed User
        • Oct 2007
        • 1448

        #4
        Not that I know of, nope. Maybe look into mod_rewrite, but I doubt it.
        xMarkPro -- Ultimate Blog Network Management
        Streamline your marketing operations. Centralize management of domains, pages, Wordpress blogs, sponsors, link codes, media items, sales and traffic statistics, plus more!

        Comment

        • klinton
          So Fucking Banned
          • Apr 2003
          • 8766

          #5
          well the problem is that i know those 2 rules in htaccess, don't know how to make one rule of them

          RewriteCond %{HTTP_REFERER} ^http(s)?://(www\.)?aaa.com(/)?.*$ [NC]
          RewriteRule .* link_to_redirect [R]

          this was by referer...


          RewriteCond %{HTTP:Accept-Language} (ru) [NC]
          RewriteRule .* redirect_to [L]

          and this was by language........

          Comment

          • klinton
            So Fucking Banned
            • Apr 2003
            • 8766

            #6
            bump..........

            Comment

            • fris
              Too lazy to set a custom title
              • Aug 2002
              • 55679

              #7
              why do you wanna do both? usally its just 1, or is it for only 1 domain?

              and if its 1 domain, why not redirect it without the language since its going to be the same domain all the time.
              Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.

              Comment

              • Tom_PM
                Porn Meister
                • Feb 2005
                • 16443

                #8
                In mod rewrites, the AND is implicit I thought. Did you try simply placing both rewrite conditions before the rewrite rule?
                43-922-863 Shut up and play your guitar.

                Comment

                • fris
                  Too lazy to set a custom title
                  • Aug 2002
                  • 55679

                  #9
                  Here is what you want if you want to do both

                  Code:
                  RewriteEngine on
                  RewriteCond %{HTTP_REFERER} ^http(s)?://(.*\.)?google\.com/ [NC]
                  RewriteCond %{HTTP:Accept-Language} (ru) [NC]
                  RewriteRule .* http://www.google.ru [R,L]
                  will redirect if the refer is google and the language is russian, and will redirect to russian version of google (both have to be true or it wont redirect)

                  hope this helps
                  Since 1999: 69 Adult Industry awards for Best Hosting Company and professional excellence.

                  Comment

                  • klinton
                    So Fucking Banned
                    • Apr 2003
                    • 8766

                    #10
                    thank you very much, will try it....

                    Comment

                    Working...