.htaccess question...how do you do this?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • jollyperv
    Confirmed User
    • Nov 2001
    • 3927

    #1

    .htaccess question...how do you do this?

    I want to do a simple redirect from one URL to another, but only want it to redirect if the traffic is coming from 1 particular URL.

    Possible with .htaccess?
  • gooddomains
    Too lazy to set a custom title
    • Jul 2003
    • 10127

    #2
    yes, it is, httpd.apache.org is your place to read

    Comment

    • TheSwed
      Confirmed User
      • Feb 2004
      • 3483

      #3
      use this tool
      http://www.affiliateprogramslocator...._generator.php

      Cheap Viagra and Cialis Erectionpills

      Comment

      • beta-tester
        Rock 'n Roll Baby!
        • Sep 2004
        • 22562

        #4
        it is possible. Google for answer...
        the idea is: test if the site is the one you want traffic redirected if it comes from that site, redirect traffic (301 redirection is the best method).

        Sig for sale. Affordable prices. Contact me and get a great deal ;)

        My contact:
        ICQ: 944-320-46
        e-mail: manca {AT} HotFreeSex4All.com

        Comment

        • jollyperv
          Confirmed User
          • Nov 2001
          • 3927

          #5
          Thanks guys, been googling around a bit, but trying to word it for a search is tough.

          Comment

          • quantum-x
            Confirmed User
            • Feb 2002
            • 6863

            #6
            .htaccess
            -----------------------
            Redirect permanent /old-dir http://www.domain.com/new-dir/
            -----------------------

            or


            .htaccess
            -----------------------
            Redirect permanent /old-file.html http://www.domain.com/new-file.html
            -----------------------
            PrettyInCash.com - BoozedGFs.com - TeenGFs.com - JizzGFs.com- MilfUploads.com -

            Comment

            • jollyperv
              Confirmed User
              • Nov 2001
              • 3927

              #7
              Nah, that's not what I'm trying to do. I want to redirect traffic from only 1 particular URL that is not mine.
              Last edited by jollyperv; 10-18-2006, 05:08 AM.

              Comment

              • tenletters
                Confirmed User
                • Jan 2001
                • 2079

                #8
                Code:
                <script type="text/javascript">
                if(document.referrer.indexOf("www.where-traffic-is-coming-from.com") != -1)
                {
                location.href = "http://www.site-to-send-traffic.com/";
                }</script>
                it's not htaccess and must be put on each page but it works.
                Useless Without Pics

                Comment

                • jollyperv
                  Confirmed User
                  • Nov 2001
                  • 3927

                  #9
                  Originally posted by tenletters
                  Code:
                  <script type="text/javascript">
                  if(document.referrer.indexOf("www.where-traffic-is-coming-from.com") != -1)
                  {
                  location.href = "http://www.site-to-send-traffic.com/";
                  }</script>
                  it's not htaccess and must be put on each page but it works.
                  Nice, thanks I'll try that

                  Comment

                  • quantum-x
                    Confirmed User
                    • Feb 2002
                    • 6863

                    #10
                    oh right, that'd be........

                    .htaccess
                    ----------------
                    RewriteEngine On
                    rewritecond %{http_host} ^http://(www\.)?target-site\.com
                    rewriteRule ^(.*) http://www.final-site.com/$1 [R=301,L]
                    ------------------

                    Should do the trick
                    where 'target site' is the incoming site
                    PrettyInCash.com - BoozedGFs.com - TeenGFs.com - JizzGFs.com- MilfUploads.com -

                    Comment

                    • quantum-x
                      Confirmed User
                      • Feb 2002
                      • 6863

                      #11
                      Originally posted by jollyperv
                      it's not htaccess and must be put on each page but it works.
                      It's not a 301 redirect. SE traffic is lost, not to mention bunches of non JS users.
                      PrettyInCash.com - BoozedGFs.com - TeenGFs.com - JizzGFs.com- MilfUploads.com -

                      Comment

                      • jollyperv
                        Confirmed User
                        • Nov 2001
                        • 3927

                        #12
                        Thanks again guys, the javascript thing doesn't seem to be working, gonna try the htaccess.

                        Comment

                        • darksoul
                          Confirmed User
                          • Apr 2002
                          • 4997

                          #13
                          the right way:

                          Code:
                          RewriteEngine On
                          RewriteCond %{HTTP_REFERER} ^http://(www.)?othersite.com.*$ [NC]
                          RewriteRule .* http://www.google.com [R,L]
                          1337 5y54|)m1n: 157717888
                          BM-2cUBw4B2fgiYAfjkE7JvWaJMiUXD96n9tN
                          Cambooth

                          Comment

                          • quantum-x
                            Confirmed User
                            • Feb 2002
                            • 6863

                            #14
                            Originally posted by darksoul
                            the right way:

                            Code:
                            RewriteEngine On
                            RewriteCond %{HTTP_REFERER} ^http://(www.)?othersite.com.*$ [NC]
                            RewriteRule .* http://www.google.com [R,L]
                            or the perfect way

                            RewriteEngine On
                            RewriteCond %{HTTP_REFERER} ^http://(www.)?othersite.com.*$ [NC]
                            rewriteRule .* http://www.final-site.com/ [R=301,L]
                            PrettyInCash.com - BoozedGFs.com - TeenGFs.com - JizzGFs.com- MilfUploads.com -

                            Comment

                            • darksoul
                              Confirmed User
                              • Apr 2002
                              • 4997

                              #15
                              Originally posted by quantum-x
                              or the perfect way
                              lame.
                              at least the 3rd time you got it better than your previous failed attempts.
                              The 301 redirect is meaningless unless its redirecting bot traffic.
                              1337 5y54|)m1n: 157717888
                              BM-2cUBw4B2fgiYAfjkE7JvWaJMiUXD96n9tN
                              Cambooth

                              Comment

                              • jollyperv
                                Confirmed User
                                • Nov 2001
                                • 3927

                                #16
                                Gonna try that latest one, now another question:

                                What if the incoming URL is a subdomain, and how would I need to change the (www.) part?

                                You guys rule

                                Comment

                                • quantum-x
                                  Confirmed User
                                  • Feb 2002
                                  • 6863

                                  #17
                                  Originally posted by darksoul
                                  lame.
                                  at least the 3rd time you got it better than your previous failed attempts.
                                  The 301 redirect is meaningless unless its redirecting bot traffic.
                                  Quoth apache manual:

                                  DESCRIPTION: In some cases the same web site is accessible by different addresses, like domain.com, www.domain.com, www.domain2.com and we want to redirect it to one address.

                                  RewriteEngine On
                                  RewriteCond %{HTTP_HOST} !^www.domain.com$ [NC]
                                  RewriteRule ^(.*)$ http://www.domain.com/$1 [R,L]
                                  fuck man, sorry to use code you don't understand.
                                  cram it.
                                  PrettyInCash.com - BoozedGFs.com - TeenGFs.com - JizzGFs.com- MilfUploads.com -

                                  Comment

                                  • darksoul
                                    Confirmed User
                                    • Apr 2002
                                    • 4997

                                    #18
                                    you can use (.*) instead of www
                                    1337 5y54|)m1n: 157717888
                                    BM-2cUBw4B2fgiYAfjkE7JvWaJMiUXD96n9tN
                                    Cambooth

                                    Comment

                                    • darksoul
                                      Confirmed User
                                      • Apr 2002
                                      • 4997

                                      #19
                                      Originally posted by quantum-x
                                      Quoth apache manual:



                                      fuck man, sorry to use code you don't understand.
                                      cram it.
                                      lol,
                                      you just made a fool out of your self
                                      read again genius, HTTP_HOST is your domain and it will never
                                      match the reffering domain.

                                      do you dig it ? or do I have to draw it for you ?
                                      1337 5y54|)m1n: 157717888
                                      BM-2cUBw4B2fgiYAfjkE7JvWaJMiUXD96n9tN
                                      Cambooth

                                      Comment

                                      • quantum-x
                                        Confirmed User
                                        • Feb 2002
                                        • 6863

                                        #20
                                        Originally posted by darksoul
                                        lol,
                                        you just made a fool out of your self
                                        read again genius, HTTP_HOST is your domain and it will never
                                        match the reffering domain.

                                        do you dig it ? or do I have to draw it for you ?

                                        sigh. I just woke up.
                                        Still, you can cram your attitude
                                        PrettyInCash.com - BoozedGFs.com - TeenGFs.com - JizzGFs.com- MilfUploads.com -

                                        Comment

                                        • darksoul
                                          Confirmed User
                                          • Apr 2002
                                          • 4997

                                          #21
                                          Originally posted by quantum-x
                                          Quoth apache manual:



                                          fuck man, sorry to use code you don't understand.
                                          cram it.
                                          also the shit you posted redirects ALL referrers instead of one.
                                          you got some comprehension problems.
                                          1337 5y54|)m1n: 157717888
                                          BM-2cUBw4B2fgiYAfjkE7JvWaJMiUXD96n9tN
                                          Cambooth

                                          Comment

                                          Working...