Have both "index.html" and "index.php" as directory index?

I’m using Middleman PHP. In my config.rb I have activated directory_indexes.

Problem is that this only works for files that are rendered as HTML-files. So “about.haml” becomes “/about/index.html”.

I have a “contact.php.erb” page, but that gets rendered as “/contact.php”.

Is there some way to include “set :index_file, “index.php”” in my config.rb in an if / else statement? So I can have the directory indexes for both HTML & PHP pages?

It turns out there is a way to do this.

Put your ‘contact’ page in:

/contact/index.php.erb

Then add the following line to your config.rb file:

page "/contact/index.php", :directory_index => false

You’ll end up with an index.php file in the contact directory, just the way (I think) you want it.