Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

HTML How to Make a Website Adding Pages to a Website Build the Contact Page

Luke Lappen
Luke Lappen
3,524 Points

Switching Pages in preview

I can switch between the pages About and Contact, but when i click portfolio it comes up as page not found. But when i run preview from the index.html it comes up. So what is going on here?

5 Answers

Tobias Helmrich
Tobias Helmrich
31,602 Points

Hey Luke,

could you please post your code? :)

Luke Lappen
Luke Lappen
3,524 Points

i'm using c9, so i'm not sure how i would do that without copy and paste

Tobias Helmrich
Tobias Helmrich
31,602 Points

Well, but without seeing your code everyone here can just guess where the problem might be which would be suggestions like check all of your links in the href attributes, your folder structure, etc.

Luke Lappen
Luke Lappen
3,524 Points

this is the Index.html

<!doctype html>

<html>

<head>
  <meta charset="utf-8">
  <title>Luke Lappen | Web Developer </title>
  <link rel="stylesheet" href="css/normalize.css">
  <link href='https://fonts.googleapis.com/css?family=Changa+One|Open+Sans:400italic,700italic,400,700,800' rel='stylesheet' type='text/css'>
  <link rel="stylesheet" href="css/main.css">
</head>
<body>
  <header>
    <a href="index.html" id="logo">
      <h1>Luke Lappen</h1>
      <h2>Web Developer</h2>
    </a>
    <nav>
      <ul>
        <li><a href="index.html" class="selected">Portfolio</a></li>
        <li><a href="about.html">About</a></li>
        <li><a href="contact.html">Contact</a></li>
      </ul>
    </nav>
  </header>
  <div id="wrapper">
    <section>
      <ul id="gallery">
        <li>
          <a href="img/numbers-01.jpg">
            <img src="img/numbers-01.jpg" alt="">
            <p>Experimentation with color and texture.</p>
          </a>
        </li>
        <li>
          <a href="img/numbers-02.jpg">
            <img src="img/numbers-02.jpg" alt="">
            <p>Playing with blending modes PS.</p>
          </a>
        </li>
        <li>
          <a href="img/numbers-06.jpg">
            <img src="img/numbers-06.jpg" alt="">
            <p>80 styles of glows.</p>
          </a>
        </li>
        <li>
          <a href="img/numbers-09.jpg">
            <img src="img/numbers-09.jpg" alt="">
            <p>Drips in photoshop brushes.</p>
          </a>
        </li>
        <li>
          <a href="img/numbers-12.jpg">
            <img src="img/numbers-12.jpg" alt="">
            <p>Shapes using repitions.</p>
          </a>
        </li>
      </ul>
    </section>
    <footer>
      <a href="http://twitter.com/lukelappen"><img src="img/twitter-wrap.png" alt="Twitter Logo" class="social-icon"></a>
      <a href="http://facebook.com/lukelappen"><img src="img/facebook-wrap.png" alt="Facebook Logo" class="social-icon"></a>
      <p>&copy;  2016 Luke Lappen.</p>
    </footer>
  </div>
</body>

</html>

THIS IS THE ABOUT.html (Contact is the same as this for now)

<!doctype html>

<html>

<head>
  <meta charset="utf-8">
  <title>Luke Lappen | Web Developer </title>
  <link rel="stylesheet" href="css/normalize.css">
  <link href='https://fonts.googleapis.com/css?family=Changa+One|Open+Sans:400italic,700italic,400,700,800' rel='stylesheet' type='text/css'>
  <link rel="stylesheet" href="css/main.css">
</head>
<body>
  <header>
    <a href="index.html" id="logo">
      <h1>Luke Lappen</h1>
      <h2>Web Developer</h2>
    </a>
    <nav>
      <ul>
        <li><a href="index.html">Portfolio</a></li>
        <li><a href="about.html" class="selected">About</a></li>
        <li><a href="contact.html">Contact</a></li>
      </ul>
    </nav>
  </header>
  <div id="wrapper">
    <section>
      <img src="img/luke.jpg" alt="Photo of Luke Lappen" class="profile-photo">
      <h3>About</h3>
      <p>Hi, I'm Luke Lappen and I like blue turtles. blah blah blah blah blah blah blah blah blah blah blah</p>
      <p>If you'd like to follow me on Twitter, my username is <a href= "http://twitter.com/lukelappen">@lukelappen</a></p>
    </section>
    <footer>
      <a href="http://twitter.com/lukelappen"><img src="img/twitter-wrap.png" alt="Twitter Logo" class="social-icon"></a>
      <a href="http://facebook.com/lukelappen"><img src="img/facebook-wrap.png" alt="Facebook Logo" class="social-icon"></a>
      <p>&copy;  2016 Luke Lappen.</p>
    </footer>
  </div>
</body>

</html>

Tobias Helmrich
Tobias Helmrich
31,602 Points

Alright, thank you! I just copied everything and tried it out on my machine and everything was working just fine. I could switch between all the sites. Just to make sure: Did you check your file structure and that all the files (especially index.html) don't have typos or anything like that? Are all files in the same folder or are there subfolders?

Luke Lappen
Luke Lappen
3,524 Points

Maybe it is just c9 acting up. All are in the same folder. Thank you for checking it out.

Luke Lappen
Luke Lappen
3,524 Points

I'm still getting page not found even when using tree houses workspace

Tobias Helmrich
Tobias Helmrich
31,602 Points

Now that you're using workspaces, could you make a snapshot of your workspace and share it?

Luke Lappen
Luke Lappen
3,524 Points

i just figured it out, so simple. The file name was Index.html. in the code it was index.html. Upper case letter brought back the error. ha i feel dumb