tags:

views:

22

answers:

1

i have a files directory on my local web server and i want to make it so that only local users can view the directory list. for example if a friend visits the site from his house, he should not be able to see site.com/files/ but can get the file site.com/files/image.png. for local users i want them to be able to do both. i tried the following code but it does not work. any ideas?

SetEnvIf REMOTE_ADDR 192.168.1.* local
<IfDefine local>
Options +Indexes
</IfDefine>
<IfDefine !local>
Options -Indexes
</IfDefine>
Allow from ALL
Deny from NONE
A: 

Create .htaccess with the following and place it in /files/.

order deny,allow
deny from all
allow from 192.168.1
vls