title: execute script when directory listing by .htaccess
body: <p>I have a http server (apache HTTPD v2.4) where directory listing is enabled. I configured it to use the 'fancy-index' from <a href="https://github.com/Vestride/fancy-index" rel="nofollow noreferrer">https://github.com/Vestride/fancy-index</a>, and works great. However, its searching function didn't give what I was looking for.</p>
  
  <p>I'd like to configure the webserver such that if I goto <a href="http://mywebserver.com/someDir/*?list" rel="nofollow noreferrer">http://mywebserver.com/someDir/*?list</a>, it will return a list of all the files in someDir in a "file, filesize" format.</p>
  
  <p>Or, if I goto <a href="http://mywebserver.com/someDir/essay2020*.txt?list" rel="nofollow noreferrer">http://mywebserver.com/someDir/essay2020*.txt?list</a> , I'll get a custom list of all essay2020*.txt files. Or some form of a simple regex: say "essay2020[0-2]*.txt".</p>
  
  <p>I can write a php/perl/python script that can read a directory and return the 'file, filesize' list. But how do I configure the .htaccess to call this script? Do I have to muck around with 'RewriteRule'? or something special? </p>
  
  <p>As an added note, I'm not limited to modifying .htaccess only. If I can do all of this by modifying the httpd.conf, I'm open to that suggestion too. </p>
  
  <p>Thanks.</p>