• 28-12-2013, 12:30:19
    #1
    Merhaba arkadaşlar siteme google botları haricinde hiç kimsenin girmesini istemiyorum. Böyle birşey htaccess ile mümkünde sanırım. Bu konuda bilgisi olan varsa yardım ederse sevinirim..
  • 30-12-2013, 10:19:40
    #2
    htaccess ile (denemedim ancak çalışır diye düşünüyorum)

    Alıntı
    RewriteCond !%{HTTP_USER_AGENT} (googlebot) [NC]
    RewriteRule ^ - [L]
    php ile aşağıdaki kodu kullanarak google botları tespit edebilirsin.

    <?php
    function botDetect()
    {
    $bots_list=array(
    "Google"=>"Googlebot",
    //"Yahoo"=>"Slurp",
    //"Bing"=>"bingbot"
    /*You can add more bot here*/
    );
    $regexp='/'.  implode("|", $bots_list).'/';
    $ua=$_SERVER['HTTP_USER_AGENT'];
    if(preg_match($regexp, $ua,$matches))
    {
    $bot=  array_search($matches[0], $bots_list);
    return $bot;
    }
    else
    {
    return false;
    }
    }
    ?>