Benvenuto in Snippets Q&A, dove potrai porre quesiti e ricevere risposte da altri membri della community.
0 voti

Directory Indexes

When a directory is requested, Apache may be configured to send a particular file within that directory automatically. This is configured with the DirectoryIndex directive. It can list one or more files that Apache should search for in the directory, with the first existing file being returned to the client. For example:

DirectoryIndex index.html index.htm index.php welcome.html

Directory Listings

If no file from the DirectoryIndex directive can be located in the directory, then mod_autoindex can generate a listing of the directory contents. This is turned on and off using the Options directive. For example, to turn on directory listings for a particular directory, you can use:

<Directory /usr/local/apache2/htdocs/listme>
  Options +Indexes

To prevent directory listings (for security purposes, for example), you should remove the Indexes keyword from every Options directive in your configuration file. Or to prevent them only for a single directory, you can use:

<Directory /usr/local/apache2/htdocs/dontlistme>
  Options -Indexes

Excluding Files

If you would like listings to be enabled, but you want to omit particular files, you can use the IndexIgnore directive. For example, to omit any filename starting with tmp and also the parent directory link (..), you could use:

IndexIgnore tmp* .
da (160 punti)

La tua risposta

Il nome che vuoi visualizzare (opzionale):
Privacy: Il tuo indirizzo e-mail sarĂ  utilizzato esclusivamente per l'invio di queste notifiche.