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

CSS How to Make a Website Adding Pages to a Website Add a New Page

Error 404

I have a problem with copying and pasting index.html to about.html and receive a 404 error message, why?

Already made sure the names are correct.

Nav as per below:

<nav> <ul> <li><a href="index.html" >Portfolio</a></li> <li><a href="about.html">About</a></li> <li><a href="contact.html">Contact</a></li> </ul> </nav>

2 Answers

Sue Dough
Sue Dough
35,800 Points

The file does not exist you are trying to access and that is why you are getting a 404. Make sure to create the about.html and contact.html file. They will need to be in the same folder of your index.html file.

Done but still getting error 404.

Created about.html and contact.html. Put them together under one folder together with index.html

Sue Dough
Sue Dough
35,800 Points

Does the URL in the browser show about.html at the end of it when you click it and it 404's?

Yes.

URL: http://port-80-83t5axdrtj.treehouse-app.com/About.html

Error message:

404 Not Found

nginx/1.6.2

Sue Dough
Sue Dough
35,800 Points

Could you have named your files or code with a capital by any chance? Everything should be lowercase.

Yes did that check also.

All reference to any pages are in lower cases

Is there any other possible scenarios?

Sue Dough
Sue Dough
35,800 Points

http://www.tinyupload.com/

Upload your ZIP here and post the URL. That way I can check locally.

Sue Dough
Sue Dough
35,800 Points

Okay I downloaded both of them and put it into a folder called test. The about.html page does not 404 and it works fine. I did notice the files I downloaded were named about.html.txt and index.html.txt . I am not sure if you had to change them to text files to send them. If you didn't, that could be your error. You would need them to be about.html and index.html and make sure they are HTML documents and not txt.

I usually do local testing in XAMPP. However in your case I just right clicked the file and pressed open with chrome.

I left the .txt

I am new to coding so I taught if the file extension of .html you might not be able to open it.

So what you are saying is that it works locally just not through the workspace?

William Li
William Li
Courses Plus Student 26,868 Points

just get rid of the .txt, file extension should be .html, end of story.

William,

The .txt is only for the attached text files.

The about.html page doesn't work from the workspace.

I am having the same problem. Everything looks the same as the video shows but I get an 404 Not Found message when I click on About.