Knowledgebase: Website Help
IP banning using .htaccess
Posted by Bill Kish on 16 January 2005 11:49 AM
From the .htaccess file, you can ban certain IP addresses from getting access to your site at all. You’ll need to add the following into your .htaccess file:


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


All the work you need to do is replace the "xxx.xx.x.x" with the IP you want to ban. You can also do more than once, just add the "deny from xxx.xx.x.x" under the previous one, like this:


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


This shows you that three IP addresses are being blocked. You could also change “allow from all” to “deny from all” to turn everyone away from your site. It's just that easy!

Comments (0)
TotalChoice Hosting, Inc.