Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

index.html vs default.html

Tags:

html

iis

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?

like image 591
Galwegian Avatar asked Jun 15 '10 10:06

Galwegian


People also ask

What is the difference between home html and index html?

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.

What is a default html?

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.

Does it have to be index html?

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.

Why is it called index html?

Because that's the file name the server sees as an index file.


2 Answers

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

like image 149
Quentin Avatar answered Oct 11 '22 03:10

Quentin


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:

  • Creating web services the RESTful way
  • RESTful URLs
  • Cool URIs don't change (towards the bottom, it suggests one omit file extensions).
like image 9
Michael Aaron Safyan Avatar answered Oct 11 '22 04:10

Michael Aaron Safyan