HTML How to Make a Website Beginning HTML and CSS Follow Along with Workspaces

hamza shaikh
hamza shaikh
5,875 Points

why is it important that we name the main file index.html ?

will it not work the same if i name it something else

2 Answers

Steven Parker
Steven Parker
176,778 Points

When a connection is made to a web site without specifying a specific file in the URL, most servers return a default page. This page is known as the "landing page" and most servers will provide by default a file named "index.html" Thus, a connection made to "http://mysite.com" turns into "http://mysite.com/index.html".

Generally, a server can be configured to use a different file file as a landing page if desired, but "index.html" is the most common and typically the name used unless the developer or administrator has a reason to configure the server otherwise.

I'll include an addition to this comment. There are three (3) default page known by most web servers, they are index.html and index.htm that already well-known, and also default.htm on some windows servers. As long as you use one of those three names, that will be considered as your main page.

Simon Sørensen
Simon Sørensen
17,304 Points

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