In this tutorial I’m going to learn how to block any IP Address using .htaccess file so follow this tutorial we ‘have demonstrated in very easy way.
Example 1: Block One IP Address:
simply create .htaccess file in your root directory and add following code on it.
.htaccess
order deny,allow
deny from all
allow from 13.127.15.21
Next open below IP address in browser
13.127.15.21
![](https://www.devopsfreelancer.com/blog/wp-content/uploads/2023/08/image-68-1024x460.png)
Now IP address is block thanks for reading this 👍
[…] How to Restrict/Block IP Address using .htaccess File? […]