View Full Version : Banning IP's with .htaccess?


Pykkalo
02-03-2004, 04:37 PM
I have a couple questions on banning IP addresses from my site.

1. I don't have the full IP addresses, I only have the first 3 groups of numbers and the last group is only an asterisk (for example, 12.345.67.#). Can I ban IP addresses that way? Or do I need the exact IP instead of a range? There's a couple troublemakers I'm having problems with but my traffic report (through Site Meter) doesn't give me the full IP.

2. Does it matter if the .htaccess file is uploaded in ASCII mode or binary mode?

3. How can I tell if it's working?

Moth
02-03-2004, 07:07 PM
1) You don't need to add the last number as a wildcard. You can just do "deny from 12.345.67." and that will match everything in the range of 12.345.67.0-255.

2) I guess you could use ascii but if you are uploading from a Windows system to a Unix system or vice versa then it's probably best to use Binary given that the two systems use a different character to show the end of a line (causes confusion in text editors and the like).

3) Just check your logs. If the ip is being allowed through then it isn't working ;)