I found this neat trick the other day… If you notice someone is trying to hack your website, or just would rather a certain individual not stop by anymore, its very easy to ban the offender if you’re using Apache as your webserver.
- Create a file in the top-level directory of your website – the same one that contains the index or “main page” of your site. Name this file “.htaccess”
- Put the following code in the file:
order allow,deny
deny from 192.168.0.1
allow from all - Replace “192.168.0.1″ with the ip address of the person you’re trying to block. If you’d like to block multiple IP addresses, add as many
deny from <ip address>lines as you want under the first, right aboveallow from all.
If you enjoyed this post, make sure you subscribe to my RSS feed!
