Overclock.net banner
1 - 4 of 4 Posts

· Registered
Joined
·
947 Posts
Yeah, drop it in your root. Just use notepad or whatever.
(Put quotes around it when you save it as ".htaccess" so it won't append it with .txt)

Looking around, looks like on Windows you may need to edit the httpd.conf

This guy has an amusing writeup


http://forums.livingwithstyle.com/ar...t149577p1.html

Sorry, never done it on Windows.
 

· Registered
Joined
·
947 Posts
Been a while since I have used Apache (I could have this done in a half second in IIS...)

Your .htaccess file would look something like:

<Files *>
order allow,deny
deny from 127.0.0.1
allow from all
</Files>

Just replace 127.0.0.1 with the IP you want to block.
You can also block by domain - replace IP with "blah.com" (no quotes)

I think I remember always useing this directive too:

<Files .htaccess>
deny from all
</Files>

Also, your deny line can using masking or multiple entries.. I highly recommend against using domain names - else Apache has to go out and resolve names (big perf hit.)

So a deny line could look like:
deny from 127.0.0.1 127.0.0.2

Blocked two IPs.

Or:

deny from 127.0.0

You blocked that whole subnet.

You should also kill directory browsing using DirectoryIndex.
 

· Registered
Joined
·
947 Posts
In notepad, put quotes around ".htaccess"

It will let you. (Wait, what OS are you on?)

Edit:
And ifn you really want to run apache, I recommend a move to *ux. Running it on Windows is like putting a Chevy engine in a Toyota.
Sure, it can work. But why try?
 
1 - 4 of 4 Posts
This is an older thread, you may not receive a response, and could be reviving an old thread. Please consider creating a new thread.
Top