.htaccess is a very powerful tool to keep control on who can do what on your website, it’s also fairly easy in case some things go wrong it will show Error 500 page so you can go back and make any change. Some time you may need to block certain IP which is ominous to your website/server or is trying to attack your server by creating load on it such as DDOS attack, then you can track and simply block such IPs using .htaccess file. Once you manage to get the IP address which is going to hit your server then you just need to add it in deny list of htaccess file.
All IPs which are listed in this list can’t access your site to any further extent and thus you can defend your server from such attacks. All you have to do is to add IP in your htaccess file which is located at root directory
You can put in as many IP address as you want in this list but you should make sure to use a robust firewall for your server, your host providers can manage your dedicated server for such security issues and will monitor it round the clock.

