Apache

How to Ban an IP Address using .htaccess

Written by Ian Carnaghan · 12 sec read >

If you do not want a certain person/IP Address to access your website you can add the following code to your .htaccess file 

order allow,deny 
deny from xxx.xxx.xxx.xxx 
allow from all

In the above code replace the xxx with the IP Address that you would like to Ban accessing your website

Last Updated On March 22, 2018
Written by Ian Carnaghan
I am a software developer and online educator who likes to keep up with all the latest in technology. I also manage cloud infrastructure, continuous monitoring, DevOps processes, security, and continuous integration and deployment. In my spare time I teach undergraduate classes in web development. Profile

Leave a Reply

avatar
  Subscribe  
Notify of