You are not logged in.
- Topics: Active | Unanswered
#26 2015-02-16 12:30 am
- Alex Kemp
- Moderator
- From: Nottingham, England
- Registered: 2009-12-02
- Posts: 2,457
- Website
Re: HOW TO: Convert bannedips to htaccess
banning users via .htaccess
The Aggregator (link in my sig) has an `hta' output option that will give an .htaccess file.
Offline
#27 2015-02-16 12:37 am
- Flavio93Zena
- Member
- From: Italy
- Registered: 2014-12-24
- Posts: 15
Re: HOW TO: Convert bannedips to htaccess
Which is not bad indeed, but there was no guide and you can really tweak anything with that. Also if people learn to understand how it works perhaps it would be useful since if you put a single comma in the wrong spot you can shutdown your whole site with a mistake in that file
Last edited by Flavio93Zena (2015-02-16 12:38 am)
I'm an angel with a shotgun,
fighting 'til the war's won,
I don't care if heaven won't take me back.
Offline
#28 2015-02-16 1:15 pm
- Alex Kemp
- Moderator
- From: Nottingham, England
- Registered: 2009-12-02
- Posts: 2,457
- Website
Re: HOW TO: Convert bannedips to htaccess
I was trying to add to your useful tutorial/guide, Flavio93Zena, not replace it.
The basic function of the Aggregator is to aggregate a bunch of IPs down to the minimum possible. Output options such as `HTA' are there to add value & save effort.
Offline
#29 2015-02-16 1:22 pm
- Flavio93Zena
- Member
- From: Italy
- Registered: 2014-12-24
- Posts: 15
Re: HOW TO: Convert bannedips to htaccess
I was trying to add to your useful tutorial/guide, Flavio93Zena, not replace it.
Never meant to confront Just want to help out, I remembered I had made that guide for another community (that definitely didn't deserve it...) so I thought about sharing it.
I might add another little point on how to use the "*" to ban specific restricted intervals.
And in case you decide to change signature... http://forums.modem-help.co.uk/aggregate.php
Last edited by Flavio93Zena (2015-02-16 1:23 pm)
I'm an angel with a shotgun,
fighting 'til the war's won,
I don't care if heaven won't take me back.
Offline
#30 2015-08-19 10:54 am
- Stryderunknown
- Member
- Registered: 2015-06-28
- Posts: 2
Re: HOW TO: Convert bannedips to htaccess
Here's something that might be useful.
(This Applies to Ipv4 only. If you develop a website locally for testing then you might want to comment out your IP range)
For .htaccess:
Denying all Reserved and Restricted IP's by their CIDR
Just edit the start of your Deny block in a .htaccess file:
Deny from 0.0.0.0/8
Deny from 10.0.0.0/8
Deny from 169.254.0.0/16
Deny from 172.16.0.0/12
Deny from 192.0.2.0/24
Deny from 192.168.0.0/16
Deny from 224.0.0.0/4
For php plugins:
It can be handy to use a filter_var() with FILTER_FLAG's when checking any IP's for submission to see if they are in the Reserved or Restricted ranges. If used correctly it can stop attempts to submit spammers that are using spoofed IP ranges in reserved blocks.
filter_var($ip_address, FILTER_VALIDATE_IP, FILTER_FLAG_NO_PRIV_RANGE | FILTER_FLAG_NO_RES_RANGE)
Last edited by Stryderunknown (2015-08-19 10:56 am)
Offline