Learn how to block individual IPs, IP ranges or whole countries via .htaccess on your Simply webhosting.
You can use .htaccess to block access to your website from individual IP addresses or IP ranges.
The following syntax can be used to block:
<RequireAll>
Require all granted
# Block single IP
Require not ip 192.0.2.1
# Block IP range
Require not ip 192.0.2.0/24
# Block IP range
Require not ip 192.0.2
</RequireAll>
And if you want to block all access, except from individual IP addresses:
Require ip 69.46.36.0/27
Require ip 192.0.2.1
Just add the relevant lines to your webhosting .htaccess file.
See also https://httpd.apache.org/docs/2.4/howto/access.html#host
If you want to block access from selected countries, you can use this tool: https://www.ip2location.com/free/visitor-blocker
Select “Apache 2.4 .htaccess deny” as the output format and then add the content to your .htaccess file.
Article from the support category: PHP