In this article:
You can easily block IP addresses from reaching your website through your .htaccess file. You can edit your .htaccess file by launching Webby (our free and simple-to-use FTP site editor). Once you've accessed your .htaccess file, you can do the following:
Block/Allow IP addresses
To set a rule, you can follow the template below:
Order Allow,Deny
Deny from 123.123.123.123
Allow from all
The example above states, that the IP address 123.123.123.123 is blocked and will not be able to reach your website.
If you have more than one IP you'd like to block, simply list them as follows:
Order Allow,Deny
Deny from 123.123.123.123
Deny from 234.234.234.234
Block/Allow specific IP address ranges
You can also block ranges or subnets of IP addresses by setting from-to values in IP addresses.
Order Allow,Deny
Deny from 123.123.123.0/24
Allow from all
You can also use * for whole octets:
Order Allow,Deny
Deny from 123.123.*.*
Allow from all
Comments
0 comments
Please sign in to leave a comment.