Sometimes website administrators are forced to restrict access to a specific user from accessing their site.
Usually, this happens in a scenario where you notice that you are receiving persistent spam or bogus form submissions.
A lot of times, forums can be spammed from a single user, and manual IP address blocking may resolve the problem.
When blocking an IP address via the .htaccess file in your website root directory, the user will be served the default 'Forbidden' page when trying to access your site.
This will take effect immediately upon making the changes to the .htaccess file. There's no need to restart your web server.
Note that it's very likely that the user (or spambot) will attempt accessing your site from a different IP address once they realize that they are refused access.
Because of this, we recommend that manual IP address blocking is used only on a short-term basis.
If you're having persistent problems with spam bots or problematic users, it's best to install a solution that will integrate spam prevention on your website in the first instance.
To manually block an IP address, open (or create) the .htaccess file in your website root directory, and add the following line at the top of the file:
Deny from 220.127.116.11
Save and close the file, and you're all done!
Again, for persistent spam we definitely recommend an automated long term solution, integrated into either your website, or your server infrastructure.
If you require assistance with spam prevention, perhaps we can help!