1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

[Code Request] How to redirect under a Condition.

Discussion in 'Black Hat SEO' started by Siek, Aug 9, 2008.

  1. Siek

    Siek Regular Member

    Joined:
    Feb 4, 2008
    Messages:
    456
    Likes Received:
    294
    I know this is somewhere on the forum. I've been looking and i can't seem to find it.

    Could someone please provide me with the code where a REDIRECT would only happen if they came from a specific site? This would avoid any problems with the companies finding my blackhat traffic if referrals were to pass that is. I would set up the redirect on my white hat site and therefore, the companies wouldn't have any traces of my blackhat site. I know this had something to do with stuffing a cookie on the blackhat site and enabling it on the whitehat site. (correct me if im wrong).

    Or is there an easier way to do this? if i made a subdomain on my whitehat site and did a redirect from there, would the referral be just the domain and not the subdomain?

    I hope that makes sense..

    Thanks in advance. =)
     
  2. BravoSix

    BravoSix Newbie

    Joined:
    May 25, 2008
    Messages:
    24
    Likes Received:
    2
    You should be able to do this in .htaccess by using:

    Code:
    RewriteCond %{http_referer} ^http://([^.]+\.)*(yoursite)\.com
    RewriteRule ^$ yourblackhatsite.html [R=302,L]
    If the traffic comes from yoursite in the first line, it is redirected to yourblackhatsite.html


    I'm sure there are other ways too, particularly using php, but this should serve your basic purpose (if I understood you correctly).
     
    • Thanks Thanks x 1
  3. Siek

    Siek Regular Member

    Joined:
    Feb 4, 2008
    Messages:
    456
    Likes Received:
    294
    This is exactly what i was looking for - except for the fact that i wanted all my blackhat traffic redirected to my whitehate site. But i can see how i can change that easily.

    Thanks alot man.