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 Introduction to HTML and CSS (2016) Adding a New Web Page Set up an HTML Document

my new html page isn't showing when I preview

I have created a new html file and wrote the code and previewed and added /resume.html hoping to see the preview the page, but it wasn't found

The requested URL /resume.html/ was not found on this server.

Steven Parker
Steven Parker
231,269 Points

To facilitate analysis, you can make a snapshot of your workspace and post the link to it here.

4 Answers

Did you save the code that you wrote before you clicked on preview?

Thank you it seems the problem was that I had not indented well. I must have missed the significance of indents whe writing html elements

Yes I had saved

Randy Hauck
Randy Hauck
422 Points

The title of your page is affected by capitalization. I named the title of my page "Resume.html" but was entering "/resume.html" in the URL field and was receiving an error message. I removed the capitalization from the the name of my page, and the problem was solved.

This should be the official answer.

The clue is in the error message: "was not found on this server".

There is no way that changing indentation, which would be transparent to your browser anyway, would cause a 404 "page not found" error. This came down to the browser not being able to find the HTML file in the first place - not because of the file's contents but because the URL didn't match the name EXACTLY as it was entered in the workspace.

I think it's important to point this out because to say that adjusting your indentation will ever solve your 404 errors is just going to cause frustration. What seems to have happened is that Ushasha's second attempt INADVERTENTLY had matching capitalization.

The underlying problem here (and the reason that more than half the questions seem to be about the same issue) is that the video doesn't specifically warn people against naming their resume file with a capital letter: "Resume.html". So they use a capital letter there because it looks good but then go into auto pilot and type the URL in their browser using all lower case letters (not realizing that the case of the HTML file and the URL must match exactly).

thank you, problem resolved now, I had not indented

Steven Parker
Steven Parker
231,269 Points

How strange! Indentation, and spacing in general, is normally ignored in HTML. For the benefit of other readers, could you post a before/after example?

Just pointing out this had nothing to do with indentation for anyone else finding this thread. :)

Indentation is just used to make it easier to read code. It doesn't impact its functionality and is transparent to the browser.

No matter what is going on INSIDE an HTML file, it cannot cause a browser to complain that it cannot FIND the target file. That comes down to incorrect file paths (or in this case, mismatched capitalization).

If there was something wrong with formatting of the contents of your HTML file then, for the browser to get that far, it would already be past the "Page not found" stage, so you would get something other than a 404 error.

A lot of questions on this video were from people experiencing this exact same issue: 404 error caused by the URL having different capitalization from the "Resume.html" or "resume.html" file.

If you're not sure, just try trying to cause a 404 "Page not found" error with the "wrong" indentation... you won't be able to!

Then try changing the capitalization of either your resume URL or your resume HTML file, you'll see that that recreates the error 100% of the time.

Unfortunately I had not taken screenshots before and after. though I can't be conclusive if its about the indentation, but after I indented it showed fine

Steven Parker
Steven Parker
231,269 Points

Perhaps you fixed another syntax error while adjusting the indentation. As I said, spacing in general (indentation, blank lines, etc) is normally ignored in HTML.