apache.htaccessip-restrictions

Easiest way to block IP's from an internet provider (several sub/ranges)?


My site is being visited lately by IP's (bots?) like this:

XX.XX.XX.XX.broad.pt.fj.dynamic.163data.com.cn

IP Location China China Fuzhou Chinanet Fujian Province Network


The behaviour is the same - (I guess) they are trying to get admin id of a wordpress blog.

GET /blog/wp-login.php HTTP/1.1

then

GET /blog/?author=1 HTTP/1.1

where author=1 to 10


How to block IP's like "XX.XX.XX.XX.broad.pt.fj.dynamic.163data.com.cn"

where XX.XX.XX.XX ranges are 110.*.*.*, 59.*.*.*, ...unknown.

EDIT: my site is on shared hosting - no access to server configuration. Please .htaccess solution if possible (I want to block access on site level, not on wordpress level)


Solution

  • Try the following rule:

    RewriteEngine On
    RewriteCond %{REMOTE_ADDR} pt\.fj\.dynamic\.163data\.com\.cn$
    RewriteRule ^ - [F]