index.html

I am learning javascript using tutorials on line. I have a question about handling code files on my pc. Specifically, index.html. Must this file be called index or can it be called for example myProgram.html in a folder called myProgram. Or must index.html be in a folder called myProgram. I hope my question is clear. Thank you.

1 Like

Hi Findid - your question is clear! Your HTML files can be named anything you want! You can have one folder with a bunch of differently named HTML files also. For example, here is what one of my folders looks like:

When you upload files online to a web server, index.html and index.htm get some special treatment. For example, let’s say the URL to your index.htm is https://www.example.com/foo/index.htm, you can just type https://www.example.com/foo/ This behavior is also why when you visit a web site, you just type in google.com as opposed to google.com/index.html

Let us know if this helped :slight_smile:

Cheers,
Kirupa

1 Like