Banning IPs with htaccess

  • wpas
  • Proficient
  • Proficient
  • User avatar
  • Posts: 322
  • Loc: Canada

Post 3+ Months Ago

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
  • Anonymous
  • Bot
  • No Avatar
  • Posts: ?
  • Loc: Ozzuland
  • Status: Online

Post 3+ Months Ago

  • Zealous
  • Guru
  • Guru
  • User avatar
  • Posts: 1244
  • Loc: Sydney

Post 3+ Months Ago

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
  • Proficient
  • Proficient
  • User avatar
  • Posts: 322
  • Loc: Canada

Post 3+ Months Ago

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
  • Zealous
  • Guru
  • Guru
  • User avatar
  • Posts: 1244
  • Loc: Sydney

Post 3+ Months Ago

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
  • Proficient
  • Proficient
  • User avatar
  • Posts: 322
  • Loc: Canada

Post 3+ Months Ago

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.

Post Information

  • Total Posts in this topic: 5 posts
  • Users browsing this forum: No registered users and 88 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
 
 

© 1998-2014. Ozzu® is a registered trademark of Unmelted, LLC.