15

I've used both index.html and default.html in the past for home pages on sites I've built. These days I mostly use index.html, but I'm not sure why... consistency I suppose.

I'm pretty sure IIS handle them the same, but I am wondering, though, if there's any benefit or pitfall in using one over the other, or are they treated the same in all respects?

1
  • IIS cannot handle them the same way? What happens if you have both? Commented May 27, 2013 at 14:38

8 Answers 8

26

index is traditional, and more servers are configured to look for it than for default.

Sign up to request clarification or add additional context in comments.

6 Comments

@David - Thanks for that. I'm sure you're right, but have you a source to support this?
That's from experience, but the upvotes suggest a lot of people agree.
originally it was index.html on apache etc and default.htm (note the missing l) on IIS. Microsoft wanted to do everything differently back then
@seanizer, by "back then" you imply that they wish to conform to standards now, which I'd say is hardly the case.
@michael: well it's somewhat less the case now than it was back then, but no: ms is not famous for embracing standards
|
9

I prefer index.html (I think this is typically more popular), but that said it doesn't matter, because users should never know the name of the file from which they are being served!!!. If you are giving users links such as http://path/to/some/name_of_entity.html, then you are doing things wrong! Links should be clean and look like http://path/to/some/name_of_entity/. Use rewriting rules (if necessary) to, behind the scenes, serve the request using a specific page (e.g. to make http://path/to/some/entity/ serve from http://path/to/cgi-bin/entities.pl?name=blah without the user seeing the actual resource or extension). The name of the actual page is an implementation detail that no one should ever know about, and by hiding this implementation, it gives you the freedom to switch between index.html, default.html, index.php, index.jsp, and any other underlying implementation. This allows your pages to evolve and change their implementation without invalidating your URLs, and since invalidating URLs weakens the rank of your pages, it is a really good idea to set up a URL scheme that can survive changes to your website for SEO purposes.

See also:

21 Comments

I disagree, look at your address bar for this page. Stack uses MVC, which lets you easily do what you're suggesting, but most other technologies don't. Try linking a news article without showing them the file name. news.bbc.co.uk/1/hi/science_and_environment/10313173.stm
@SLC, StackOverflow does use REST. Do you see any file extensions in the URL? I don't think so. The file extension is completely hidden, and the website is structured in the form of hierarchical data. And the example from BBC is exactly how one shouldn't do it.
Because I disagree with "users should never know the name of the file from which they are being served". I was wrong about stack I misread -html as .html but that's because it uses MVC as I explained. Look at other sites that don't.
@Galwegian, the actual name of the file including its file extension is an implementation detail. Suppose in a year you want to make it more interactive, and so you change it to ".php", then all your old links with a ".html" extension are no longer valid. And then suppose a year after that, you decide to switch to Java and so you change it to ".jsp", again invalidating your ".php" links. This means your URLs are not permanent, which makes it harder to find your links. It also weakens the page rank of your page (which harms how much search engines like your page)...
@Michael: I disagree. Filename is an essential part of URL. Hiding information is generally a bad idea. Using tricks to muddle up the navigation is especially bad idea. Among other things, it makes it impossible to use the pages off-line. Generally, it is best to keep things simple. P.S. Your answer is not an answer, it is an opinion.
|
7

Although I prefer to use index.html myself (mostly because I'm more of an apache than an iis user) , I have to say that on the semantic level, default.html makes more sense.

index.html originates from a time when you could strip the page name from almost every web page there was and get a directory listing. The index.html provided an alternative way to display this directory listing. So basically: the user looks inside a folder and index.html is what he sees

default.html uses a different abstraction: the user has not specified which resource inside a certain path he wants to see, so I show him my default resource

So while one could argue that index.html is the more restful version, default.html is the service oriented version.

Of course, this is only relevant on the semantic level, on the technical level it makes no difference, all webservers in existence should be able to cope with both if properly configured.

Comments

5

The choice of the first page is absolutely yours. Few servers are configured to run for Default.html and few to Index.html. You can change these in the configuration files. For consistency purposes, use index.html. Most of the servers recognise it.

Comments

4

It is recommended to stick with either index.html or index.htm in most cases, default.html is generally used on a windows environment, i.e IIS, so you may come unstuck if you moved to Apache. Saying that you could get around this issue using a .htaccess file for Apache to use default.html as the default file location.

1 Comment

Actually, ".htm" really isn't all that common... on UNIX the file extension can be as long as you want, and so on UNIX systems (where Apache typically runs), the ".html" extension is more common.
4

IIS defaults to default.htm (not default.html) by default. Just thought that might help someone. I'm doing this for my site and going with it rather than changing the setup of the server, especially since the user doesn't need to know the extension.

Comments

1

In IIS you can set the file(s) to look for when the url points to a folder.

You can specify multiple files. And they are tried in order to see if they exist.

If your site is under heavy load, and you have a index.html, but default.html is in the list before index.html, you might have a slight decrease in performance.

So normally it does not matter.

1 Comment

This is true on IIS and Apache. (as well as most other web servers.)
0

default.html is the default page for the requesting location if no specific page is specified. ex: http://myname.com/place/ will load default.html in /place folder.

index.html is used as listing page that displays index of all available resources.

Now a days this difference is eliminated and it is hardly evident anywhere. Its now just a preference of the webmaster to decide index.html or default.html as default load.

2 Comments

Where are you quoting that from? I can't find the phrase anywhere on Google.
index.html is used as the default web page to load in all web servers I've heard of, if no specific page is requested. IIS is the only one I've seen to use default.html as well. Probably that was the original purpose of index.html, but it's hardly valid today.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.