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

Temporarily Hide Site from Humans but not SE's

Discussion in 'Cloaking and Content Generators' started by 3kaday, Nov 23, 2012.

  1. 3kaday

    3kaday Regular Member

    Joined:
    Apr 28, 2009
    Messages:
    216
    Likes Received:
    51
    Location:
    London, EUSSR
    So I need my site to appear "not trading" and to have a "coming soon" type message when inspected by some bureaucrats giving out a licence. However I don't want to mess up g's cache of the site or g to think I have changed anything. Is there a way to do this so that the SE's see the correct site but humans see the coming soon page?

    Thanks :)
     
  2. youngguy

    youngguy Senior Member

    Joined:
    Apr 11, 2009
    Messages:
    1,053
    Likes Received:
    1,560
    Location:
    Hell
    That's what we call: "Cloaking".

    Basic:
    Code:
    <?php
    
    if (strpos($_SERVER['HTTP_USER_AGENT'],"goog") === false) {
        header("location: http://urltoredirect.com/");
        exit;
    }
    
    ?>
    
    Normal HTML content you want big G to see.
    
    Advance: (more reliable)

    You need to have an updated list of search engine IP's to filter out :)

    PS: And of course, this is black hat and there are risks like bryanon stated below.
     
    • Thanks Thanks x 1
    Last edited: Nov 23, 2012
  3. ba_laz

    ba_laz Power Member

    Joined:
    Feb 17, 2011
    Messages:
    546
    Likes Received:
    464
    Location:
    Europe
    if its a WP site you can get free plugins for that,search for "coming soon" or "under construction"
     
  4. bryanon

    bryanon Executive VIP Premium Member

    Joined:
    Oct 16, 2009
    Messages:
    1,395
    Likes Received:
    1,479
    Theoretically, you could show different content based on the user's browser version and set it up so that if the browser (User-Agent) is identified as GoogleBot then one type of content will be shown, whereas if it's anything other than that the "under construction" message will show.

    But with that said, Google considers this cloaking and as such, may penalize your site if they find out. Because of this it may be better to change the site temporarily without any cloaking and just put it back live when the time is right. Sure, you'll lose your rankings temporarily but as far as my experience shows, in most cases you will get them back soon after your site is back live. I've had sites go down for extended periods of time and Google's rankings tend to come back shortly after putting the site back up (depending on how often your site is crawled).
     
  5. partymarty4870

    partymarty4870 Elite Member

    Joined:
    Jul 7, 2010
    Messages:
    2,034
    Likes Received:
    1,690
    Location:
    I come from a land downunder
    what bryanon said is pretty much my experience as well.
     
  6. 3kaday

    3kaday Regular Member

    Joined:
    Apr 28, 2009
    Messages:
    216
    Likes Received:
    51
    Location:
    London, EUSSR
    Thanks, I just tried that and it redirected me ok. Is there a way to test what the bots see?

    Also what is the best way to add bing and yahoo to that code.

    Cheers!

     
  7. bryanon

    bryanon Executive VIP Premium Member

    Joined:
    Oct 16, 2009
    Messages:
    1,395
    Likes Received:
    1,479
    There's a plugin for Firefox that lets you change your user agent. Google it.
     
  8. youngguy

    youngguy Senior Member

    Joined:
    Apr 11, 2009
    Messages:
    1,053
    Likes Received:
    1,560
    Location:
    Hell
    Yeah, or if you use Chrome, install this extension:
    Code:
    https://chrome.google.com/webstore/detail/user-agent-switcher-for-c/djflhoibgkdhkhhcedjiklpkjnoahfmg
    
    And use one of these User Agents:
    Code:
    http://support.google.com/webmasters/bin/answer.py?hl=en&answer=1061943
    

    Notice that any user-agents they use have the word "Google" or "Goog" :D
     
  9. footballfreak

    footballfreak Newbie

    Joined:
    Nov 17, 2012
    Messages:
    8
    Likes Received:
    1
    Thanks for all the responses to this question. I didn't ask it, but found responses helpful.
     
  10. ProMax

    ProMax Newbie

    Joined:
    Feb 29, 2012
    Messages:
    20
    Likes Received:
    0
    You can also setup your .htaccess file on the server to redirect by referer:

    Code:
    RewriteEngine On
    RewriteCond %{HTTP_REFERER} .*google.*$ [NC,OR]
    RewriteCond %{HTTP_REFERER} .*ask.*$ [NC,OR]
    RewriteCond %{HTTP_REFERER} .*yahoo.*$ [NC,OR]
    RewriteCond %{HTTP_REFERER} .*baidu.*$ [NC,OR]
    RewriteCond %{HTTP_REFERER} .*youtube.*$ [NC,OR]
    RewriteCond %{HTTP_REFERER} .*wikipedia.*$ [NC,OR]
    RewriteCond %{HTTP_REFERER} .*qq.*$ [NC,OR]
    RewriteCond %{HTTP_REFERER} .*excite.*$ [NC,OR]
    RewriteCond %{HTTP_REFERER} .*msn.*$ [NC,OR]
    RewriteCond %{HTTP_REFERER} .*netscape.*$ [NC,OR]
    RewriteCond %{HTTP_REFERER} .*aol.*$ [NC,OR]
    RewriteCond %{HTTP_REFERER} .*hotbot.*$ [NC,OR]
    RewriteCond %{HTTP_REFERER} .*goto.*$ [NC,OR]
    RewriteCond %{HTTP_REFERER} .*mamma.*$ [NC,OR]
    RewriteCond %{HTTP_REFERER} .*alltheweb.*$ [NC,OR]
    RewriteCond %{HTTP_REFERER} .*lycos.*$ [NC,OR]
    RewriteCond %{HTTP_REFERER} .*search.*$ [NC,OR]
    RewriteCond %{HTTP_REFERER} .*metacrawler.*$ [NC,OR]
    RewriteCond %{HTTP_REFERER} .*bing.*$ [NC,OR]
    RewriteCond %{HTTP_REFERER} .*dogpile.*$ [NC,OR]
    RewriteCond %{HTTP_REFERER} .*facebook.*$ [NC,OR]
    RewriteCond %{HTTP_REFERER} .*twitter.*$ [NC,OR]
    RewriteCond %{HTTP_REFERER} .*blog.*$ [NC,OR]
    RewriteCond %{HTTP_REFERER} .*live.*$ [NC,OR]
    RewriteCond %{HTTP_REFERER} .*myspace.*$ [NC,OR]
    RewriteCond %{HTTP_REFERER} .*linkedin.*$ [NC,OR]
    RewriteCond %{HTTP_REFERER} .*altavista.*$ [NC,OR]
    RewriteCond %{HTTP_REFERER} .*infoseek.*$ [NC,OR]
    RewriteCond %{HTTP_REFERER} .*yandex.*$ [NC,OR]
    RewriteCond %{HTTP_REFERER} .*rambler.*$ [NC,OR]
    RewriteCond %{HTTP_REFERER} .*mail.*$ [NC,OR]
    RewriteCond %{HTTP_REFERER} .*ya.*$ [NC]
    RewriteRule .* hxxp://site2.com [R,L]