Jump to content

Archived

This topic is now archived and is closed to further replies.

dark dude

Blocking IPs from site using Htaccess

Recommended Posts

I'm using htaccess to [i]try[/i] and block specific people from using my site...

Big failure/10

[code]
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[/code]

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 [b]do[/b] 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~

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites
[quote author=dark dude link=topic=101947.msg403958#msg403958 date=1153929333]
I'm using htaccess to [i]try[/i] and block specific people from using my site...

Big failure/10

[code]
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[/code]

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 [b]do[/b] 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~
[/quote]

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.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.