Blog

Cloaking Links

by

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

4 Comments

  • Nick W 2761 days ago

    http://www.threadwatch.org

    UA cloaking? little risky wouldn’t you think?

    Reply
  • Anonymous 2761 days ago

    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

    Reply
  • IrishWonder 2759 days ago

    http://www.irishwonder.syndk8.co.uk

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

    Reply
  • DaveN 2757 days ago

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

    DaveN

    Reply

Write your comment

Optional

The Bronco Family
Work With Us