Most of my visits are from baidu spiders. I don't think it helps search engines at all so I'm thinking of how to block them. Could this be done via iptables? I'm using nginx as my webserver.
|
|
In your robots.txt add
|
|||||||
|
|
You can block by IP address using the
To block a range, use CIDR notation, like |
|||
|
|
|
You can use the following directive in
However, crawlers may decide to ignore the content of your robots.txt. Moreover, the file can be cached by search engines and it takes time before changes are reflected. The most effective approach is to use your server capabilities. Add the following rule to your
Remember to restart or reload Nginx in order to apply the changes. |
|||
|
|