Cloaking Links

why does this work in google ??

ok what do you need to know

PHP:

$agent=$_SERVER[”HTTP_USER_AGENT”];

ASP :

sUserAgent= Request.ServerVariables(”HTTP_USER_AGENT”)

OK this will get RETURN you a User Agent, Btw Google’s UA is

Googlebot/2.1 (+http://www.googlebot.com/bot.html)

PHP code and usage :

< ?php

// showing one link for Google
// and one link for everyone else

if (strpos(strtolower($_SERVER['HTTP_USER_AGENT']), "googlebot"))
	echo '<a href="http://www.site-a.com/">Site A for GoogleBot';
else
	echo '<a href="http://www.site-b.com/">Site B for the rest of us</a>';

// adding rel nofollow for GOOGLE

if (strpos(strtolower($_SERVER['HTTP_USER_AGENT']), "googlebot"))
	$rel = ' rel="nofollow"';
echo "<a href="http://www.site-c.com/"$rel>Site C</a>";

// keyword stuffing for GOOGLE

if (strpos(strtolower($_SERVER['HTTP_USER_AGENT']), "googlebot"))
	echo '<h1>Welcome to my site buy viagra uk cheap ciallis reductil</h1>';
 else
	echo '<h1>Welcome to my site</h1>';

// showing spam content to google and redirecting users to a feed partner

if (!strpos(strtolower($_SERVER['HTTP_USER_AGENT']), "googlebot")) {
	header("HTTP/1.1 302 Moved Permanently");
	header("Location: http://www.my-feed-partner.com/");
	die;
}
echo "<p>Lots of keyword spam content here. Hello GoogleBot, we think we're clever</p>";
?>

play with some toys :
user agent switcher

Share and Enjoy: These icons link to social bookmarking sites where readers can share and discover new web pages.
  • Digg
  • Sphinn
  • Live
  • StumbleUpon
  • Facebook
  • Google
  • Reddit
  • Technorati

4 Comments | Leave a comment »

  1. 1. Nick W | October 26th 2005 @ 4:53 pm

    UA cloaking? little risky wouldn’t you think?

  2. 2. Anonymous | October 26th 2005 @ 5:01 pm

    yep i would .. but i seen sites do it and the last google update let it though and the 2 part of the update is letting it though,… matbe part 3 will catch it.. my guess it will not ;)

    DaveN

  3. 3. IrishWonder | October 28th 2005 @ 7:00 pm

    How about replacing a UA detection piece by IP detection piece? Wouldn’t it be a better solution?

  4. 4. DaveN | October 31st 2005 @ 10:13 am

    IrishWonder : correct it would be but you really need to keep upto date with IP’s and mixture is the best ;)

    DaveN

Leave a Reply

required

required, hidden