Of course, it is possible to deny a particular IP address access to your Joomla site.
Reasons could be:
- Someone is trying to hack your website.
- Someone is copying content from your website.
- Someone is linking to images or other media on your website.
- Someone attacks your website with many requests.
- Someone continuously spamming your website.
You can deal with this in several ways.
Block an IP address with Akeeba Admin Tools PRO
You can block an IP address using an extension such as the PRO version of Akeeba Admin Tools.
Through the Web Application Firewall, you can also automate things. For example, you can have a particular IP address blocked after X number of failed login attempts. (Note that you may also potentially be blocked yourself if you don't add your IP address to the Whitelist.)
Blocking an IP address in the .htaccess file
You can block an IP address by adding it to the .htaccess file.
- Connect to your website via FTP
- Download the file named .htaccess
- Add the following lines to the .htaccess file:
order allow,deny
deny from 12.34.567.890
allow from all
If you are being attacked by multiple IP addresses you can add as follows
order allow,deny
deny from 12.34.567.890
deny from 12.34.567.891
allow from all
Now let's assume you are being attacked by a range of IPs, for example all IPs starting with 12.34.567, here is what you need to do:
order allow,deny
deny from 12.34.567
allow from all
Now the question remains: how do you know what the IPs are that are spamming you? You check your logs and see if there are repeated requests from the same IP address.