PDA

View Full Version : htaccess question



Agum
May 27th, 2001, 18:48
Okay, this isnt CGI/ASP/PHP... but I guess this question fits in here.

how do you use htaccess to deny directory listing for a directory?

actually, i lied, i have more than 1 question. =)

how do you deny certain IPs from access to your web site/directory?

meow
May 27th, 2001, 19:22
Directory listing:

Options All MultiViews
Deny access from...

order allow,deny
allow from all
deny from .yahoo.com
deny from 123.12.12.12
You can "shorten" the IP. Like 123.12 will deny access for all who's IP begins with 123.12. Same with URLs. Just keep adding a new line for all IP's and/or domains you want to keep out.

If you want to allow access to just a few you can turn it around:


order deny,allow
deny from all
allow from ....
allow from ....