21Aug/100
Client and Server Side Cloaking
What is cloaking?
Cloaking is the method of showing different content to user based on various factors.
Examples of Black-Hat SEO cloaking:
- Search engine cloaking (serving content that ranks for a keyword to the engines in order to lure visitors in, but then redirect the visitor to another page or show them an offer for a product and/or service)
- This particular technique is against Google's webmaster guidelines and can really annoy visitors
Examples of White-Hat SEO cloaking:
- Showing slightly different content based on
- the visitor's location
- the visitor's screen size
- Banned users can be completely redirected or just straight up refused service
Client Side Cloaking Example
Put this code between the <HEAD> </HEAD> header tags:
<script type="text/javascript">
<!--
function delayer() {
window.location = "http://redirect-address"
}
//-->
</script>
Put this in your <BODY> tag:
<body onLoad="setTimeout('redirectme()', 1000)">
The number 1000 indicates time in milliseconds to wait before the page is redirected - set it to 0 to redirect immediately after the page is loaded.
Server Side Cloacking Example:
Put this somewhere in the header of your PHP file:
<?php
$ref = $_SERVER['HTTP_REFERER'];
if (FALSE) // ((strstr($ref, 'google') !== FALSE) && (strstr($ref, 'q=') !== FALSE))
{
echo '<meta http-equiv="refresh" content="0;url=http://redirect-address">';
echo "\n";
echo '</head>';
echo '<body></body></html>';
exit(0);
}
?>