Web Hosting Talk







View Full Version : .htaccess to ban access to HTTP?


inkhead
03-18-2002, 07:30 PM
Is it possible for me to use an .htaccess file to ban access by IP to a website or directory? And if so can you please give me a sample line of code. I would prefer not to use MOD_REWRITE. Thank-you.

mpalamar
03-18-2002, 07:47 PM
Put the following in a .htaccess file:

order allow,deny
allow from all
deny from 211.101.**.**

-Mike

inkhead
03-18-2002, 09:38 PM
Thanks!

Will .htaccess still work if I were to say ban a domain name foo.com instead of an IP? I'm just curious. Thanks.