title: Apache directory index on demand
body: <p>Within Apache, how can I call the default directory index creator on-demand?</p>
  
  <p>Here's the situation. Requirement is to display, say, a default image file for a URL that corresponds to a directory. That's easy to do, using mod_dir. But a further requirement is that, when the image is clicked (in the browser), display a directory listing. Now I realize that can be done by writing some directory-listing code (in PHP, say). But that seems like re-inventing the wheel. So ideally I'd like to invoke the code in mod_autoindex directly.</p>