Take the 2-minute tour ×
Webmasters Stack Exchange is a question and answer site for pro webmasters. It's 100% free, no registration required.

If I maintain www.example.com, does accessing it mean I would open index.html in its root directory?

share|improve this question

migrated from serverfault.com Jan 5 '12 at 5:57

This question came from our site for professional system and network administrators.

add comment

2 Answers 2

What will occur depends on how you have setup your web server.

A web server may be setup to display an index page - that is a page that is displayed when a directory is accessed. In this case, the server will typically try all the files listed (e.g. index.htm, index.html, index.php, etc) in the order listed, and display the first one that is available, or an error if none are available. While 'index.*' is commonly used, it is not required. Web servers typically allow you to specify the index file, and will load the corresponding file.

Alternatively, your web server could be setup to display the content of a directory - in this case, it will not serve the index page, but rather a listing of all the files in the directory.

Of course, your server could be setup to do something completely different, such as redirect the user to a specific page or another site.

You should be able to check your access (and error) logs to determine what exactly occurs for your particular scenario.

share|improve this answer
add comment

Depending on the webserver you're running and its configuration, yes.

It is very common that index.html is read from the folder the webserver points to if you don't add a filename in the URL. In Apache, for example, these filename(s) are defined in the configuration with the directive DirectoryIndex.

In Microsoft IIS default.asp is a common default filename.

share|improve this answer
    
I think I'm using Apache. –  stanigator Jan 5 '12 at 3:49
    
Then its right, and like I said, defined in DirectoryIndex if you would want to change or add more. Other common ones added could be index.php and index.htm (to support Windows 3-letter filesuffix). –  Mattias Ahnberg Jan 5 '12 at 4:19
add comment

Your Answer

 
discard

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