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?
Whilst there is no difference it would be beneficial to have index. html, as it is the default and it will help you reduce web server config time if you are using clean-urls e.g. domain.com/contactus, domain.com/aboutus, etc instead of domain.com/contactus/home.html and domain.com/aboutus/home.html, etc.
The HTML default Attribute is a Boolean attribute. This attribute is used to specify that the track will be enabled if the user's preferences do not indicate that another track would be more appropriate. Note: With a default attribute, there must not be more than one track element per media element.
The default landing page of many Web servers defaults to index. html or default. htm and either way it's simply a start page. It's not necessary at all.
Because that's the file name the server sees as an index file.
index is traditional, and more servers are configured to look for it than for default.
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:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With