Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Code Block
languagetext
# Deny all robots that we do not specifically want to allow
User-agent: *
Disallow: /

# Allow these robots only
User-agent: slurp
Allow: / 

User-agent: bingbot
Allow: /

User-agent: googlebot
Allow: /
 

But if robots.txt doesn't help, you may block bots in your .htaccess file. First of all, we need to find out how to identify a bot. You will need to check your raw access logs using appropriate option in your Cpanel. The "User Agent" string in the logs is the one we need. For example, in the line below you may see YandexBot string:

Code Block
HTTP/1.1" 200 927 "-" "Mozilla/5.0 (compatible; YandexBot/3.0; +http://yandex.com/bots)"

 

This is what we need. In order to block Yandex bot, you need to add the following into your .htaccess:

 

Code Block
BrowserMatchNoCase YandexBot bad_bot
Order Deny,Allow
Deny from env=bad_bot

The other bots can be blocked by adding BrowserMatchNoCase directive in the same way.

Content by Label
showLabelsfalse
max5
spacesGKB
sortmodified
showSpacefalse
reversetrue
typepage
labelsblock bad bot access accessing website robots file Google Bing Microsoft MSN Scooter

...