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

Redirect browser traffic but allow SE spiders

Discussion in 'Black Hat SEO' started by christopher, Aug 28, 2009.

  1. christopher

    christopher Newbie

    Joined:
    Jan 29, 2009
    Messages:
    13
    Likes Received:
    7
    like the title says, how can i redirect traffic coming from a certain site but allow the SE spiders through?

    I know I can set up an htaccess to redirect traffic but will it also redirect SE's?

    I'm fairly positive that code can be written in the htaccess to look at the source of a hit and know if it's a browser or a spider and then redirect accordingly, but, if I knew what I was doing I wouldn't be asking.

    thanks
     
  2. matapples01

    matapples01 Regular Member

    Joined:
    May 15, 2008
    Messages:
    358
    Likes Received:
    208
    It's called cloaking. You can find solutions from $50 to $5,000. If you're using wordpress check out WPCloaker. There's a thread on here with a BHW discount too.
     
  3. jonnyh431

    jonnyh431 Junior Member

    Joined:
    Jan 27, 2009
    Messages:
    165
    Likes Received:
    105
    Location:
    UK
    Try putting this somewhere in your index.php file, I haven't tested it but it should work.

    Code:
    <?php
    $browser = $_SERVER['HTTP_USER_AGENT'];
    if($browser == "googlebot" || "msnbot" || "yahoo")
    {
    header('Location: http://searchenginesgohere.com/');
    }
    else
    {
    header('Location: http://normalusersgohere.com/');
    }
    ?>
     
  4. BadArticle

    BadArticle Junior Member

    Joined:
    Aug 10, 2009
    Messages:
    100
    Likes Received:
    29
    Home Page:
    You also need reverse DNS check to filter out fake robots

    Code:
            $result = false;
            $ip = $_SERVER['REMOTE_ADDR'];
            $ip12 = substr($ip, 0, 12);
            $ip9 = substr($ip, 0, 9);
            $ip8 = substr($ip, 0, 8);
            $ip7 = substr($ip, 0, 7);
            $ip6 = substr($ip, 0, 6);
            $ip5 = substr($ip, 0, 5);
            if (($ip7=='66.249.')||($ip6=='65.55.')||($ip6=='72.30.')||($ip5=='74.6.')||($ip12=='216.129.119.')) {
                $result = true;
            }
            if ( !$result && preg_match("/.*(googlebot|slurp|msnbot|teoma|twiceler).*/i", $agent, $matches) ) {
                $host = gethostbyaddr( $ip );
                if ( $matches[1] == 'googlebot' ) {
                    $result = ( substr($host, -14) == '.googlebot.com' );
                } elseif ( $matches[1] == 'slurp' ) {
                    $result = ( substr($host, -16) == '.crawl.yahoo.net' ) || ( substr($host, -15) == '.corp.yahoo.com' );
                } elseif ( $matches[1] == 'msnbot' ) {
                    $result = preg_match("/.*\.search\.(msn|live|bing)\.com$/i", $host);
                } elseif ( $matches[1] == 'twiceler' ) {
                    $result = preg_match("/.*\.(cuill|cuil)\.com$/i", $host);
                } elseif ( $matches[1] == 'teoma' ) {
                    $result = preg_match("/^crawler\d+\.ask\.com$/i", $host);
                } else {
                    $result = true;
                }
                if ( $result ) {
                    $result = false;
                    foreach ( gethostbynamel($host) as $realip ) {
                        if ( $realip == $ip ){
                            $result = true;
                            break;
                        }
                    }
                }
    You also can try
     
  5. iglow

    iglow Elite Member

    Joined:
    Feb 20, 2009
    Messages:
    2,080
    Likes Received:
    856
    Home Page:
    is it possible to add to it some kind of ip verification from .txt file? i mean when somebody ivist it checks not only useragent but also list of ips from txt file [without txt the code will be too long and page will eb too slow].
     
  6. AUTOATTACKER

    AUTOATTACKER Registered Member

    Joined:
    Jul 16, 2008
    Messages:
    83
    Likes Received:
    23
    Home Page:
    Im looking for someone to setup dmr :) please pm