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

Alex Raymond
Alex Raymond
1,626 Points

Issue with the preview page

Hi, i’m learning HTML and i have a problem with the preview of my page. When i click on preview it doesn’t land directly on my page but on the index page. It appears like : Index of/ and then i have to choose index.html, but i don't know why it doesn't open directly as a webpage.

Thank you !

2 Answers

Steven Parker
Steven Parker
229,670 Points

The Preview function opens the default landing page, which is typically index.html unless it has been reconfigured on the server.

Besides the configuration change, you could use page redirection or just rename your page as "index.html".

What is the name of the file you wish to preview? Perhaps you can change its name to index.html. Most servers will render index.html automatically (unless they have been configured to render some other file by default).

Also, if you're attempting to preview a parent directory of some index.html file, you'll likely get the result you've mentioned.

Alex Raymond
Alex Raymond
1,626 Points

The name of the file i wish to preview is index.hmtl. I also have an image folder with some pictures. So when i try to preview, i have Index of/, index.html and img. So when i open index.html it doesn't show the picture that i linked. How do i fix that ?? Thank you