问题
Got a folder at http://myserver/folder/, I have disabled directory browsing for that folder.
But I want to enable directory browsing for the subfolders of http://myserver/folder/
How can I do this??
Thanks.
回答1:
here's a working simple solution:
<Directory /path/to/docroot/folder>
Options -Indexes
</Directory>
<DirectoryMatch /path/to/docroot/folder/(.)*/>
Options +Indexes
</DirectoryMatch>
回答2:
If you do not control apache, you can do this in a per-directory basis in your own files adding .htaccess file in the corresponding directory containing
Options +Indexes
回答3:
Here is an option that you can use from .htaccess:
Options +Indexes
RewriteRule ^$ - [F]
回答4:
You can just change the permissions of the respective folders. However, if you don't want to allow directory browsing at the /folder/ level, they'll need some link or way to get inward to the folders where you do allow browsing.
回答5:
You can do this with an .htaccess file in each subfolder or at the top of each subfolder hierarchy. http://httpd.apache.org/docs/2.2/mod/core.html#allowoverride ~ assuming apache
回答6:
Your mileage might vary ...
.htaccess how no effect
neither did
Options +Indexes
but renaming index.html to _index.html display the files and folders in the browser
回答7:
Another way is, if you have a directory you don't want browseable, create an empty index.html file in it, hopefully apache will pick that up and serve it instead :)
回答8:
For any directory where you want to have the ability to list the directory, simply navigate there then execute this command:
echo "Options +Indexes" >.htaccess
来源:https://stackoverflow.com/questions/6686381/subfolder-directory-browsing-in-apache2