Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

HTML

Isn't calling every new file "index.html" confusing?

Do you always have to save the home page of a website as "index.html"?

If so, doesn't this quickly become confusing?

5 Answers

No. You're saving it in it's own folder so the names don't conflict unless they are in the same directory. If you have two index.php files, your site is going to break so it's not something that should ever be a problem or an occurrence.

Why would it become confusing? All homepages are index.html or index.php. There's only one per project so, there's only one in each directory. And yes you do. Web servers look for index.php first. You could call it something else but then your url would be domain.com/something.

Sorry, I should have been more specific:

When you are coding the page on sublime 2 (or whatever you use) and saving the file to your computer, surely you can only save the file as "index.html" once before your computer says "This file already exists, do you want to replace it?".

Would you save your file as index with the project name? For instance "index1/smellslikebaking.html"? In order to stop the name being seen as replicated by your computer?

Thanks for your answer though!

Each website is in its own separate folder. Every folder on your computer can have an index.html/index.php file. You just cant have two in one folder if you get what I mean.

Well that's cleared that up!

Thanks a lot for your help guys.