I have seen a lot of people been using that file name for their HTML files. I wonder why? I'm kind of new to HTML, I haven't learned much, but when I name my HTML files, I name them whatever I want. When I have been searching up examples of HTML, I have found they name it index.html. Why?
I have seen a lot of people been using that file name for their HTML files
You would typically use that name for one of your page, and it would usually be the home page.
When you arrive a website, for example www.website.com
, you're not pointing to a file (like you would be if you typed www.website.com/about.html
), you're pointing to a directory listing of all the files.
The webserver will try to serve a file, typically called index.html
or index.php
by default, but it could be something different, and it's configurable by editing your webserver's config files.
If the server doesn't find any file to serve (because you didn't include an index.html
file or because you renamed it without editing the server's config) you will see a listing of the files, which is rarely the desired behavior, especially at the root of a website.
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