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

Send Google Bot to a Different URL?

Discussion in 'Black Hat SEO' started by agag2, Jun 15, 2012.

  1. agag2

    agag2 Supreme Member

    Joined:
    Feb 17, 2009
    Messages:
    1,308
    Likes Received:
    254
    Hi
    I have a website example .com (not real) is it possible to send google to one URL and a (real) user to another..


    example .com /URL1
    For user it stays on example .com /URL1 but for google bot it redircets to
    example .com/bot or some other external URL..

    How would I do this?
    Thanks
     
  2. wowhaxor

    wowhaxor Executive VIP Premium Member

    Joined:
    Apr 28, 2007
    Messages:
    2,021
    Likes Received:
    3,360
    Location:
    ?¿?
    Home Page:
    Search for "cloaking" which is a general term used for sort of throwing up variations/redirects between search engine spiders/bots and users. There are a crap ton of sample and simple code snippets to use depending on your specific need.
     
  3. agag2

    agag2 Supreme Member

    Joined:
    Feb 17, 2009
    Messages:
    1,308
    Likes Received:
    254
    Can anyone offer code for this specific task..

    One that tricks all google spiders..
     
  4. skrode

    skrode Junior Member

    Joined:
    Nov 13, 2011
    Messages:
    103
    Likes Received:
    16
    Code:
    <?php
    if ( strstr(strtolower($_SERVER['HTTP_USER_AGENT']), "googlebot") ) {
        header('Location: http://www.example.com/');
    }
    ?>
    
     
    Last edited: Jun 15, 2012
  5. agag2

    agag2 Supreme Member

    Joined:
    Feb 17, 2009
    Messages:
    1,308
    Likes Received:
    254
    Thanks.

    Where would I enter URL 1 and the secodn (redirect) URL..


    Im intrested in redirecting many different pages on my site to many different urls (external)
     
  6. skrode

    skrode Junior Member

    Joined:
    Nov 13, 2011
    Messages:
    103
    Likes Received:
    16
    does this suit your needs?

    Code:
    <?php
    
    $urls = array(
        "http://url1.com/a.html" => "http://redirecturl1.com",
        "http://url2.com/b.html" => "http://redirecturl2.com",
    );
    
    if ( strstr(strtolower($_SERVER['HTTP_USER_AGENT']), "googlebot") ) {
        foreach(array_keys($urls) as $url) {
            if ( strstr($url, $_SERVER['REQUEST_URI']) ) {
                header('Location: ' . $urls[$url]);
                return;
            }
        }
    }
    
    ?>