Advice needed with Google Cloaking

richrich123

Newbie
Joined
Mar 25, 2012
Messages
7
Reaction score
3
Hello,

I have seen this snippet of code below on a few places which claims to need to be added to the .htacess. i have tried this but all that happens is my index page then gives a 500 internal server error as soon as the code is added to the .htacess

Has anyone got any ideas why this is not working.

Cheers
Rich

<?php
if (strstr($_SERVER[?HTTP_USER_AGENT?], ?Googlebot?)) {
header(?HTTP/1.1 301 Moved Permanently?);

// Insert the site whose PR you want to fake
header(?Location: add your domain?);
exit;
}
else {
// Insert the URL of your real site here
header(?Location: add domain?);
exit;
};
?>
 
hmmm...
That code is PHP, it's not meant to be put in .htaccess.

What this code does is it checks if the user agent contains the word "Googlebot". If so, redirects you to "add your domain" else to "add domain".

Just put the code at the top of your index.php file and it should work.

You should also, for example, check IP address. This code is not complete.
Posted via Mobile Device
 
This will get you banned for trying to hide content from Google once your site gets a manual review.

But until then, have fun I guess :)


To be safe(r), use an IP based list. This will only detect some of Google's bots even, not all of their bots has this UA.
 
Am I only one who noticed clearly stated note - Insert the site whose PR you want to fake. ?
Anyways, This code looks like one of those fake page rank scripts, used by people who want to trick somebody to buy the site or domain for bigger price, mostly on Flippa, presenting fake PR.
 
As stated before, this is php code to be used in php script, nothing to do with .htacess

This is a safe script?

Its better than a simple js cloacking but can still be detected by modificate user agent and compare data send. Google use this trick for sure so i would say:
- No, its not completly safe!

So how to be completly safe?

Google's bots have now, from some time, the ability to execute AJAX/JS. Its great for indexing dynamic comments but really bad for cloacking. Except if you know how to trap bots.
 
To be on the safe side- it is best not to use this and not to count on this. Because you never know if these ever changing google algorithms will Punish your site for this. So it is not worth it.
 
b4br is right, this isn't htaccess code and will break htaccess, but it is PHP (notice the <?php ?> code).

What this code does is detects if the browser useragent contains the string 'googlebot' and if it does then it redirects the bot to a different page with a 301 redirect, trying to send whatever page juice that the original site contains to the redirect domain. In other words it's an attempt to manually focus the measured traffic power from one site to another...

Let's say you have a blog that get's traffic but you do not care about it.
I believe the idea is to take the search engine traffic and send it to your money site and increase the perception of your money site's exposure.
But I'm not certain that's what it's for either...
 
User agent detection is not a reliable cloaking technique for organic or paid advertising. In addition to Google's set of IPs they will also use shadow bots (spiders coming from locations with DNS not identified to any Google Inc company), partners (malware scanning companies, etc.), and manual reviewers to look at destination URLs and check organic listings. UA detection is overall very weak as a single way for detection. Use a commercial cloaker with good tech support that has and maintains a large database of IPs and fingerprints.
 
Back
Top