What The Heck Is Index.HTML? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 2

What The Heck Is Index.HTML?

So, I was zooming along with these lessons really well and I was learning a bunch of new stuff when I got uploading images for the first time. Now I'm stuck. I'm using photos from my hardrive so I can't get it to work by typing <img src="" alt"">. I have to copy the photo as a path. I'm trying to learn why this won't work when I stumbled upon the word index.html. I see everyone keep talking about it but I can't understand what it means. Is it the name of the code or what? Thank you.

23rd Oct 2017, 7:50 PM
Dylan D
Dylan D - avatar
3 Answers
+ 2
index.html is one of conventional "default" document names. It's a document that would be shown by default from a directory. Suppose we have a web server, configured to have "C:\www\" for www-root directory. Suppose that server has a domain name "example.com". So if you enter the url "http://example.com" in your browser, the server should "serve" you it's www-root directory ("C:\www\"). Usually, the server will be configured to have some "default" document names. One of such names is "index.html. If a document with a default name is present in the server's directory, then it will be shown. So if you have files "index.html" and "other_page.html" in the server root directory, then you'll get index.html contents shown if you enter either "http://example.com" or "http://example.com/index.html"; you can access other_page.html by url "http://example.com/other_page.html". If you wand to know all this in detail, I recommend you to play with web servers on your own computer. Just install LAMP or anything similar. Here's some info on ISS' default document configuration (not that I'm a fan of ISS, it's just the first thing google gave me): https://www.iis.net/configreference/system.webserver/defaultdocument?showTreeNavigation=true
23rd Oct 2017, 8:32 PM
deFault
+ 1
index.html is a default document that will be shown from a directory. In the address bar you enter URL — it's like a path to the contents. A document is shown in the big window area. Here's a random URL: "https://developer.android.com/studio/index.html". Whether you enter "https://developer.android.com/studio/index.html" or "https://developer.android.com/studio/", the default "index.html" will be shown.
23rd Oct 2017, 9:06 PM
deFault
0
Oh. I think I understand it now. So "index.html" is just what shows up in the little window bar when you're using the Internet? Thanks so much for all the info! I really appreciate it.
23rd Oct 2017, 8:55 PM
Dylan D
Dylan D - avatar