Discussion:
Default Directory Listings To Recognized IP Addresses
(too old to reply)
SMH
2011-12-16 10:29:36 UTC
Permalink
I have set as forbidden any directory listings. I use a special
"DirectoryListing.php" file within a directory that provides the listing (it
is a recognized "index" file.

But for some directories and their subdirectories, I want to use Apache's
default directory listing, and I want the server to authenticate an IP
address for giving the listing.

For example, suppose the directory is "/path/to/ThisDirectory" and I want
Apache to give dir listing of it and its subdirectories only to recognized IP
addresses. How would you write the configuration?
alpha omega
2011-12-16 21:37:34 UTC
Permalink
Post by SMH
I have set as forbidden any directory
listings. I use a special
"DirectoryListing.php" file within a
directory that provides the listing (it is a
recognized "index" file.
But for some directories and their
subdirectories, I want to use Apache's
default directory listing, and I want the
server to authenticate an IP address for
giving the listing.
Why not use the DirectoryListing.php file in those directories as well
and add this to the .htaccess file?

<Files DirectoryListing.php>
order deny,allow
deny from all
allow from 64.208.63.65
allow from 85.234.150.249
</Files>

Or add this to the directories in question:

Options +Indexes

order deny,allow
deny from all
allow from 64.208.63.65
allow from 85.234.150.249

Of course that would block all files except to the ip's listed.

Continue reading on narkive:
Loading...