homepage Welcome to WebmasterWorld Guest from 54.226.235.222
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Visit PubCon.com
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
htaccess to prevent access from specific IP?
I've tried, cant get it to work.
suenick




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

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?

 

Mardi_Gras




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

How about:
(edited)

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

Visit Thailand




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

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 ?

jdMorgan




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

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

Visit Thailand




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

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 ?

jdMorgan




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

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

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved