Question

How can I modify the default folder directory in Apache?

I want to modify the directory(which shows when a folder's index.ext or default.ext pages aren't found) by appending some HTML to it, is this possible in .htaccess? If not, what're the alternatives?

index directory

Was it helpful?

Solution

You can place this .htaccess in your document root:

DirectoryIndex index.html index.php /listing.php

This will search for a index.html or index.php in the accessed folder. If both aren't existing it calls listing php from the document root (note the / in front) as fallback. Use this file to code the directory listing on your own. This way you have fully customized index pages.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top