Mod_rewrite with directories
I've been working on converting a page which was managed entirely by Joomla into static files which are wrapped with a header/footer. I know it sounds kind of crazy but there is reasoning for this. Anyway I used a spider to download the entire website as static HTML files, and then I wrote a parser script which went through all of those files, turned them into PHP files, removed the consistent header/footer and replaced those with header and footer includes. This all worked quite well and without any problems. The only problem I have found is that for whatever reason the directory structure is somewhat unusual. For instance you may have this:
While the directory blah will not contain a file index/default/etc so going to the directory blah by itself simply pulls up a directory listing.
What I am hoping is there is a way to use mod_rewrite to effectively say if there is no default file in a directory then look for a filename that has the same name as the directory with the .php extension and display it. I have already written in a bit of code in the .htaccess file to deal with the .php extension and simply allow it to work minus this extension but despite quite a bit of searching I haven't found any suggestions on how to achieve above. I imagine somewhere it is out there but I am probably simply not using the right search query. If so I apologize.
Anyway hoping someone can offer me some insight into how to achieve this.