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

As I'm quite newbie to this field, I've doubts and there are some I couldn't find on Google, i.e:

If I'm not wrong, index.html makes it possible to avoid to add the filename to the url, www.example.com/ is equal to www.example.com/index.html. And that works for the following subdirectories, right? www.example.com/music/

  • Is there any other way to achieve this without using an index.html file? (I've read smth about converting dynamic urls to static: ./?var1=value1&varN=valueN -> ./value1/valueN)

  • How can I convert www.example.com/music/ to music.example.com/ and why should it be used?

Thanks in advance!

share|improve this question
For the "should" part of the question, there are many previous threads already. – Su' Sep 13 '11 at 17:49
thank you sir! :) – Dane411 Sep 14 '11 at 12:06
up vote 3 down vote accepted

You can define which file acts as the entry page. On an Apache server, you do this with a file named .htaccess which you place in the root directory (or in a specific directory). This file is a normal text file, with following line you define an entry page:

DirectoryIndex hello.html

Now, if anybody calls your directory http://www.example.com, the page http://www.example.com/hello.html will actually be shown.

The filename index.html is just a convention. If no entry page is defined, the server tries a few default filenames like index.html, index.php, etc.

share|improve this answer

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.