HTML HTML Basics Going Further with HTML Root-relative Paths

Siddharth Pande
Siddharth Pande
9,044 Points

If we have more than one html pages in the root directory then how does the browser know to read and open index.html

If we have more than one html pages in the root directory then how does the browser know to read and open index.html before reading and opening any other html page?

1 Answer

Steven Parker
Steven Parker
171,375 Points

It's the server, not the browser, that makes this determination. When the browser request does not specify a particular file, the server's configuration contains a list of default files to look for in the root directory. The first one found in the list is sent to the browser.

The name "index.html" is simply a convention, the server can be configured to use any desired file as the default landing page.