Cacher son site aux yeux du moteur de recherche

Publié le par Oneiroi

 <?php
$trouve=strpos($_SERVER["HTTP_USER_AGENT"],"Googlebot");
if($trouve!==false){
{
header("HTTP/1.1 301 Moved Permanently");
header("Location: http://www.google.com");
exit();
}

   }
else { // le visiteur n'est pas Googlebot, lui présenter la page "standard"
?> <html>
welcom.....
</html>

 <?php
 }
 ?>

//ou alors avec un .htaccess
// RewriteEngine on
 //RewriteCond %{HTTP_USER_AGENT} ^Googlebot
//RewriteRule ^.*$ http://www.google.com [R=301]
Publicité

Publié dans Codes Sources

Pour être informé des derniers articles, inscrivez vous :
Commenter cet article