Jump to content


Photo

Blocking IPs from site using Htaccess


  • Please log in to reply
3 replies to this topic

#1 dark dude

dark dude
  • Members
  • PipPipPip
  • Advanced Member
  • 53 posts

Posted 26 July 2006 - 03:55 PM

I'm using htaccess to try and block specific people from using my site...

Big failure/10

order deny,allow
deny from 81.177.15
deny from 81.177.14
deny from 85.255.113
deny from 85.255.114
deny from 195.225.176.86
deny from 85.255.117.250
allow from all

I'm trying to do something like that (I used made up IPs for this display so nobody is threatened).

So, I blocked my friends IP as a test, and he could still use my site as normal...

My friend does not use a dynamic IP...

So, how do you block IPs from your site using htaccess, what am I doing wrong, and how what does someone entering from a "denied ip" see?


Thanks,
~Dark dude~

#2 dark dude

dark dude
  • Members
  • PipPipPip
  • Advanced Member
  • 53 posts

Posted 03 August 2006 - 01:23 PM

bump >_>

#3 apacheguy

apacheguy
  • Members
  • PipPipPip
  • Advanced Member
  • 108 posts

Posted 03 August 2006 - 09:29 PM

I have it configured in the apache config file instead of the htaccess.  Here's how I get it to work:

<Directory "C:/Program Files/Apache Group/Apache2/htdocs">
Order allow,deny
  Allow from all
Deny from ip
Deny from ip
</Directory>

If you want to use htaccess you may have to configure an override option in apache.

#4 youcantoo

youcantoo
  • Members
  • PipPip
  • Member
  • 19 posts

Posted 11 August 2006 - 11:07 PM

I'm using htaccess to try and block specific people from using my site...

Big failure/10

order deny,allow
deny from 81.177.15
deny from 81.177.14
deny from 85.255.113
deny from 85.255.114
deny from 195.225.176.86
deny from 85.255.117.250
allow from all

I'm trying to do something like that (I used made up IPs for this display so nobody is threatened).

So, I blocked my friends IP as a test, and he could still use my site as normal...

My friend does not use a dynamic IP...

So, how do you block IPs from your site using htaccess, what am I doing wrong, and how what does someone entering from a "denied ip" see?


Thanks,
~Dark dude~


Did you have "AllowOverride all" set within your httpd.conf file?

Normally one would see and "Access Forbidden" error when trying to access a blocked area.  Another posted suggested blocking ip using the apache config file instead of the .htaccess file.  That method is by far better than  using the .htaccess  By using .htaccess the server has to do a lot more work looking for the .htaccess file within all directories, there by slowing down the serving of files.




0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users