Jump to content

Blocking IPs from site using Htaccess


dark dude

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

  • 2 weeks later...
[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.
Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.