Banning IPs with htaccess

  • wpas
  • Graduate
  • Graduate
  • User avatar
  • Joined: Jul 12, 2010
  • Posts: 214
  • Loc: Canada
  • Status: Offline

Post June 17th, 2012, 7:50 pm

Hi All

I want to ban some IPs to my website using htaccess but I am finding many ways.

I need someone to advise which would be the best.

First I found the following:

Code: [ Select ]
<Limit GET POST HEAD>
Order Allow,Deny  
Allow from all
deny from 66.66.0.1
deny from 66.66.0.2
deny from 66.66.0.3
</Limit>
  1. <Limit GET POST HEAD>
  2. Order Allow,Deny  
  3. Allow from all
  4. deny from 66.66.0.1
  5. deny from 66.66.0.2
  6. deny from 66.66.0.3
  7. </Limit>


I am not sure exactly what the above limit means.
I read that the limit directive limits the IP ban to GET requests and POST actions... so they won't be able to comment but they will be able to access files. Not sure what HEAD refers to.
I do not want the IPs to be able to access anything on my website. I want them banned from anything.

Then I read there's no good reason to limit when IP banning and should use the following.

Code: [ Select ]
order allow,deny
deny from 66.66.0.1
deny from 66.66.0.2
deny from 66.66.0.3
allow from all
  1. order allow,deny
  2. deny from 66.66.0.1
  3. deny from 66.66.0.2
  4. deny from 66.66.0.3
  5. allow from all


Can someone shed some light on which method I should use

Thanks
http://www.schembrionics.com
The Ultimate Solutions Center
  • Anonymous
  • Bot
  • No Avatar
  • Joined: 25 Feb 2008
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post June 17th, 2012, 7:50 pm

  • Zealous
  • Guru
  • Guru
  • User avatar
  • Joined: Apr 15, 2011
  • Posts: 1195
  • Loc: Sydney
  • Status: Offline

Post June 17th, 2012, 10:37 pm

There is a IP manager in Cpanel but if this was me i would be banning them using the session in the site. If they can't get into the source then what can they do.

i would have it on banned ip detect, redirect to another web site.

not sure as yes there is many ways, lets see what others say.
  • wpas
  • Graduate
  • Graduate
  • User avatar
  • Joined: Jul 12, 2010
  • Posts: 214
  • Loc: Canada
  • Status: Offline

Post June 18th, 2012, 6:45 am

This may be hard to believe but I made the mistake of hosting with Rogers and they have no CPanel.

Assuming an IP is banned from my website, is there some type of on-line tool or something that I can use to verify that the IP is indeed banned.

Thanks
http://www.schembrionics.com
The Ultimate Solutions Center
  • Zealous
  • Guru
  • Guru
  • User avatar
  • Joined: Apr 15, 2011
  • Posts: 1195
  • Loc: Sydney
  • Status: Offline

Post June 18th, 2012, 8:51 am

well i would say test it.

If banned ip requests login, do not allow login and redirect to rickrolled.

if you wana pull apart a script or better yet pull the guts out of it and use it anyway i used to play around with tbsource which is the private torrent tracker source. I find it is great php source to learn trouble shooting on lol. Anyway if the account was banned there was no access to the site and tracker access blocked.

I am sure there is a snippet of this somewhere.
  • wpas
  • Graduate
  • Graduate
  • User avatar
  • Joined: Jul 12, 2010
  • Posts: 214
  • Loc: Canada
  • Status: Offline

Post June 18th, 2012, 3:18 pm

What I want to do is to prevent a banned IP from any access at all to my website.
If they try to access, they should get something like "Forbidden" or You are not allowed access to this website.

I do not want a redirect but only whateverver error message htaccess gives the banned ip.
http://www.schembrionics.com
The Ultimate Solutions Center

Post Information

  • Total Posts in this topic: 5 posts
  • Users browsing this forum: No registered users and 96 guests
  • You cannot post new topics in this forum
  • You cannot reply to topics in this forum
  • You cannot edit your posts in this forum
  • You cannot delete your posts in this forum
  • You cannot post attachments in this forum
 
 

© 2011 Unmelted, LLC. Ozzu® is a registered trademark of Unmelted, LLC.