Change defaults index extension

Hello,

Now, for an interworx box, the default index extension is html or php.

A lot of users use htm as default extension index page : index.htm

How could we add index.htm as default index page too for all siteworx users ?

We’d like to have as default index page :
index.php
index.html
index.htm

Thanks for your help

Would probably be easiest to create a file named
/etc/httpd/conf.d/directoryindex.conf
and put

DirectoryIndex index.htm

in that file. You can add more variations also, like

DirectoryIndex index.htm index.shtml default.htm

and remember to restart apache so the changes take affect.

You can also put this in a .htaccess file in the html folder of the site if you want to do it only on a site by site basis.

Paul

merci Paul heu sorry in english it will be better : thanks Paul :slight_smile:

I was thinking they should be a general httpd.conf

But your solution is fine and works.

cool

Thanks

As I understand it httpd.conf is one of the files that might be alterd and overwritten in an update (part of the reason for all of the indiividual domain.com.conf files) so the less you edit that the better.

Tim

We have yet to have any of our code touch the main httpd.conf. We may in the future change this setup but for now the httpd.conf is left untouched.

Chris

Would you warn updaters that it was going to happen if it did? I for one edit these things locally and keep copies of both the original and edited file but a lot of people do it from the shell.

We would obviously try, and I’d proceed as if we were going to edit them. If/when we do we’ll obvioulsy try to not overwrite any changes but simply alter the values we’re interested in and keep all else the same.

Chris

Figured as much.

For that the record, I mentioned this because I thought I remembered Chris or somebody saying this somewhere. I try not to assume these things, especially when I am talkint to other users :slight_smile:

Tim

tim president !!!