Welcome to WebmasterWorld Guest from 54.205.74.11

Forum Moderators: Ocean10000 & incrediBILL & phranque

htaccess to prevent access from specific IP?

I've tried, cant get it to work.

   
1:25 am on May 30, 2002 (gmt 0)

10+ Year Member



I've found several tutorials on the net on using htaccess to restrict access by IP. There is someone that I am trying to keep out, or at least make it a little more trouble to get in. I've tried several different things, but every time, he keeps returning and with the same IP. Therefore, I must be doing something wrong and hope someone can help me.

I create .htaccess and load it as ascii (chmod 644), and have never had problems getting it to work for other things.

My current .htaccess looks like this:


AuthUserFile /dev/null
AuthGroupFile /dev/null
AuthName AllowLocalAccess
AuthType Basic

<Limit GET>
order deny,allow
deny from 0.0.0.0
allow from all
</Limit>


using the correct IP, of course.

I've also tried just using


<Limit GET>
order deny,allow
deny from 0.0.0.0
allow from all
</Limit>

and

order deny,allow
deny from 0.0.0.0
allow from all

None work. Am I leaving something out?

2:05 am on May 30, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



How about:
(edited)

<Limit GET>
order allow,deny
allow from all
deny from 0.0.0.0
</Limit>

2:13 am on Aug 21, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I found this message searching I want to ban a user from a site using .htaccess

Now at the top of my .htaccess I have this :

IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*

<Limit GET POST>
order deny,allow
deny from all
allow from all
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>

Can anyone tell me please what the first line the one starting IndexIgnore actually does ?

2:45 am on Aug 21, 2002 (gmt 0)

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Visit Thailand,

IndexIgnore specifies a list of files to be "hidden" when displaying the index of a directory.

For more info, see the Apache Server mod_autoindex documentation [httpd.apache.org].

suenick,

For more information about allow/deny, see the Apache Server mod_access documentation [httpd.apache.org].

When in doubt, go to the source - it's free!

Hope this helps,
Jim

3:08 am on Aug 21, 2002 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Thanks jdMorgan.

I have read those and just to make sure I understand 100%.

I want to ban X.IP.address

so should i put :

<Limit GET POST>
order deny,allow
deny X.IP.address
allow from all
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>
<Files .htaccess>
order deny,allow
deny from all
</Files>

OR should all of my 'deny, allow' be the other way round ?

3:20 am on Aug 21, 2002 (gmt 0)

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member



Visit Thailand,

I don't know - I use mod-rewrite to ban by IP, so I'm hesitant to give advice on a
method that I don't use. I encourage you to read the documentation, since it describes
the effects of the order directive precisely.

There are many good working examples of User-agent and IP-address ban lists here on
WebmasterWorld, so a site search [webmasterworld.com] might help, too.

Jim

 

Featured Threads

My Threads

Hot Threads This Week

Hot Threads This Month