Mobile app version of vmapp.org
Login or Join
Turnbaugh106

: Is it possible to force a directory index to display even if an index file exists? On my Apache server I need to display a directory index of a given folder even if it already contains an

@Turnbaugh106

Posted in: #Apache #Directory #DirectoryListing #Htaccess #ModRewrite

On my Apache server I need to display a directory index of a given folder even if it already contains an index file that has been defined in DirectoryIndex. In this case an index.html file exists, but I need to display a directory listing instead.

This has to be a directory specific override because the rest of the server must continue to use the index files as expected. At the moment I am setting the directory paths and configurations inside a VirtualHost, but I cannot find a way to remove predefined file names from the DirectoryIndex directive. The configuration successfully displays an index as long as an index file does not exist, but when entering a folder with an index file this file is loaded instead.

Any help that can be offered would be greatly appreciated. Thanks!

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Turnbaugh106

2 Comments

Sorted by latest first Latest Oldest Best

 

@Yeniel560

Assuming that DirectoryIndex and AllowOverride All|Indexes are enabled in your Apache configuration, you can use the .htaccess to change the directory listing settings on a per-folder or location basis.

Use the Location container to specify the location, then change the DirectoryIndex file to a file that doesn't exist. Apache will try to use it, the it will fallback to the directory listing.

<Location /some/path>
DirectoryIndex index.missing
</Location>

10% popularity Vote Up Vote Down


 

@Berryessa370

DirectoryIndex in htaccess or inside virtualhost/directory/location container

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme