Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

If I have a folder with files named index.html, index.htm, and index.php how it is decided which one will be used if you only list the URL to that folder? Is that something you can chose or is that up to the host?

share|improve this question
up vote 4 down vote accepted

If using Apache, it's the order the filenames are given in the DirectoryIndex directive. WAMP's default is

<IfModule dir_module>
    DirectoryIndex index.html index.php index.php3 index.htm

where index.html will be served if it exists, then index.php, and so on.

share|improve this answer
Also, on hosts where you don't have direct access to the full Apache config, you can sometimes override their settings by placing a similar rule in htaccess. Some may also let you do this through the control panel. It's best to contact them directly or use their knowledge base/forums for specifics. – Su' Sep 6 '12 at 22:14
Nice addition, @Su'. – msanford Sep 6 '12 at 22:29

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.