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.

Development Tools Creating a Project Pages Site

tylerduprey
tylerduprey
24,471 Points

Is it possible to host a site with multiple pages on GitHub Pages?

Index.html works fine but my other pages throw a 404 error even though they seem to be linked correctly. Plus, the links work on my local server.

3 Answers

Gabriel Pierce-Lackey
Gabriel Pierce-Lackey
11,012 Points

Yes it is. File path could have to be different for the files on github VS the ones on your local server.

tylerduprey
tylerduprey
24,471 Points

Thanks. You were right. I was linking to my pages using certain kind of absolute link. So, for the about page my href value was "/about/". The first forward slash tells Chrome Web Server on my local machine to go to the root and then look for the about page. Apparently GiHub pages works differently. All i had to do was change the href value to "about/" and it worked fine. Thanks again!

Gabriel Pierce-Lackey
Gabriel Pierce-Lackey
11,012 Points

Could take a look at your repo if you want, see if I can find anything that looks wrong with the file paths or anything.

Jacob Proffer
Jacob Proffer
24,603 Points

Hey Tyler,

As Gabriel mentioned, you should have no problem having a multi-page site on GitHub pages. I host a variety of sites on GitHub, including a Jekyll blog.

tylerduprey
tylerduprey
24,471 Points

Yep, you're right! I got to work. Thank you. I know this is off topic but do you know if any good Jekyll tutorials? Treehouse took down the Jekyll basics course because it was outdated and I'm having trouble finding a decent one out there in the non treehouse world. Thanks again!