I have detected that a range of IP addresses may be used in a malicious way and I don't know how to block it.
I would like to block the range 66.249.74.* from accessing my website by using the .htaccess file.
I have detected that a range of IP addresses may be used in a malicious way and I don't know how to block it.
I would like to block the range 66.249.74.* from accessing my website by using the .htaccess file.
You could use:
Or you could use this:
eg:
Great howto with ip ranges here:
http://www.wizcrafts.net/russian-blocklist.html
Also these are up to date lists of offending ip ranges.
You can go to: and enter ips and it will generate the file for you. http://www.htaccesstools.com/block-ips/
Also for example you want to block the
ip address range
you want would be:Or You Can Do:
You can indicate which addresses you wish to block using
RewriteCond %{HTTP_REFERER}
.This is a Working Example:
The example above uses a regular expression, so it will block:
https://
orhttp://
google.com
The
[F]
flag meansForbidden
. The server will return a403 Forbidden Error
.you can do it easily by adding IP Ranges to your .htaccess file by downloading the full ranges from https://www.ip2location.com/blockvisitorsbycountry.aspx and uploading the .hataccess back to the directory you want blocked.
I recently blocked Russia by this method cause of getting loads of spam registrations on my forum and the forum never needs any contribution from this country.
I’ve just used
as spam attack comes from
xxx.xxx.0-80.0-80
.Use just the first 3 octets