Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
308 views
in Technique[技术] by (71.8m points)

.htaccess - What is the htaccess Options -Indexes for?

I looked at the explanation in the apache.org site but it didn’t explained in a way I can understand. I found some info here .htaccess File Options -Indexes on Subdirectories but it doesn’t explain it either.

question from:https://stackoverflow.com/questions/15837822/what-is-the-htaccess-options-indexes-for

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

The Indexes option sets whether you can "browse" the directory or not. If indexes is set to plus, and the directory has no index.html or index.php (of whatever) file, it will show the contents of the directory just like your filemanager would do. So if there are ten images in there, it simply shows them as a list with links to the actual image. You can click them and open them.

Most of the time this is not what you want. You don't want others to see what is inside that folder. So then you turn it off with -Indexes.

Here you can see an example of an open dir, as they are called: http://www.ecoutetpartage.fr/images/


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...