Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Allow directory listing only for a IP

I've activated directory listing with this line in the .htaccess:

Options +Indexes

How can I limit this to only one IP address with having access to all files/directories for everyone (every IP)?

like image 215
Xaver Avatar asked Aug 09 '11 16:08

Xaver


1 Answers

Not tested:

allow from all
Options -Indexes
<Files *>
deny from all
allow from 195.112.15.4
Options +Indexes
</Files>

This way the Options +Indexes will be valid only for IP 195.112.15.4

like image 82
Tomas Avatar answered Sep 21 '22 02:09

Tomas