Web Hosting Talk







View Full Version : Having trouble with blocking IP's using .htaccess


genevaroth
06-30-2002, 06:27 PM
I am having trouble with blocking IP's via .htaccess
on apache, I have a small shared account

when i am editing the .htaccess file via ssh and pico do I just add the following to deny certian IP addressses



deny from 209.23.123.110
deny from 209.23.123.9


or do I have to go like this;

<Limit GET>
order deny,allow
deny from 209.23.123.110
deny from 209.23.123.9
</Limit>

I have been editing the .htaccess filr in my public_html directory
do I have to add anything else to the file for this to work? or is it better to use a cgi-wrapper script ( I dont't have a script)

Or do I have to put it somewhrere else?


I have been checking everywhere on the net but most of it is pretaining to setting passwords and denying usernames

Great opportunity to show off you extensive knowledge!

ToastyX
06-30-2002, 06:42 PM
The limit container isn't necessary, and "deny,allow" is the default order anyway, so you can just put:

deny from 209.23.123.110
deny from 209.23.123.9

...or if you want to block the entire subnet:

deny from 209.23.123

genevaroth
06-30-2002, 07:01 PM
Any place that you know of that has a decent banned spider list for cloaking purposes (babelfish)?

genevaroth
06-30-2002, 07:26 PM
OH I figured out my problem, I needed to Chmod the file to 755
works great now!!

command I ran in my FTP program
CHMOD:755:*.htaccess

just so everybody else knows