Blocking IPs

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
chris-smith
Forum Newbie
Posts: 1
Joined: Wed Sep 20, 2006 1:56 pm

Blocking IPs

Post by chris-smith »

Hi, i'm relitvlly new to php, so this may seem like a stupid question, but here goes:

I have a site (http://www.random-world.net). I've been trying to find out how to stop someone from accessing my site by blocking out their IP, after failing afew time, I asked a friend. He then created a file (.htaccess) which contains the following "deny from 217.43.192.64". Unfortunatlly, the person I am trying to block has multiple IPs. Is there any way I can block out this IP, and any simila?
AlecH
Forum Commoner
Posts: 27
Joined: Fri Feb 24, 2006 4:22 pm
Location: New Hampshire

Post by AlecH »

If tou leave a wild card at the end of the IP in the .htaccess like this

Code: Select all

Deny From 217.43.192.
Leave the last number out, this will block all IP's which have the first 3 parts of the IP.
Post Reply