Subtotal | $0.00 |
Below you can find several examples for manual blocking configuration.
These lines need to be added to the .htaccess file under all existing rules
<RequireAll>
Require all granted
Require not ip X.X.X.X
</RequireAll>
<RequireAll>
Require all denied
Require ip X.X.X.X
Require ip Y.Y.Y.Y
</RequireAll>
RewriteCond %{REMOTE_HOST} ^X\.X\.X\.X$
RewriteRule .* http://example.com [L,R=301]
RewriteEngine On
RewriteBase /
RewriteCond %{REMOTE_HOST} !^X.X.X.X
RewriteRule .* http://example.com [R=302,L]
Do not forget to replace X.X.X.X with the IP address you would like to allow or block.
To block/allow access from a specific country, you need to list all IP subnetworks that belong to this country.
This can be quite challenging for manual configuration, so it is recommended to use special online tools that have access to such country-specific IP databases.
Example of such an online resource is here.
You will need to choose the country and then copy the generated code to your .htaccess file.
The code will look like as follows:
Require all granted
Require not ip 81.52.168.0/23
...
Require not ip 188.138.10.163/32
Require not ip 188.138.78.129/32
</RequireAll>
Require all denied
Require ip 81.52.168.0/23 ... 188.138.10.163/32 188.138.78.129/32
</RequireAll>
That's it!
Need any help? Contact our Helpdesk
Need help? We're always here for you.