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

WordPress From Bootstrap to WordPress Create Bootstrap Styled Theme Templates Creating a Single Blog Listing Page

Juan García
Juan García
10,723 Points

The permalink links to an "object not found" page

After following the instructions, and setting up the home.php and single.php sites, I can see my blog template with all my posts, but when I click on any of them, it only leads to an "object not found" page. "The URL couldn't be found on this server"

I checked my code several times, any idea why this happens?

6 Answers

Zac Gordon
STAFF
Zac Gordon
Treehouse Guest Teacher

Okay, couple things we can check here:

Does the page display properly when you click from within admin to view a single post? Can you go into your permalinks settings and try reading them.
When you copy the link (not click on it) does the correct url display?

Zac Gordon
STAFF
Zac Gordon
Treehouse Guest Teacher

Can you please post up the code for the page where this is happening.

Juan García
Juan García
10,723 Points

Hi Zac,

here's a snapshot of my code so far: https://w.trhou.se/k5rvnjg8ih

I have followed your instructions in the course, but I can't spot where the problem is...

Thanks for your help!

Zac Gordon
STAFF
Zac Gordon
Treehouse Guest Teacher

What file and where do you have permalinks code included?

Juan García
Juan García
10,723 Points

I included permalinks in home.php, within the loop.

Juan García
Juan García
10,723 Points
  • From the posts menu, I can't see them either, not even when I click on preview, same "object not found". Even when I edit the post, it shows the permalink, but it leads nowhere

  • When I copy or hover over the permalink, it shows the link properly, although, and that might be the problem, in the permalink settings it's set to http://localhost/blog%20tocamates/2015/09/14/las-mates-molan-cantidad/

while in the posts menu I see http://localhost/blog tocamates/2015/09/14/las-mates-molan-cantidad/

Could that space between blog and tocamates be the problem? Would just renaming the folder and putting a dash between the two solve it? I tried editing the url to match the one in permalink settings but that didn't work...

Juan García
Juan García
10,723 Points

That was indeed the problem: my project folder was named "blog tocamates" so in general settings I changed the site URLto "http://localhost/blog-tocamates" , prior to renaming the folder to "blog-tocamates", and that solved the permalink problem.

Thanks Zac, you pointed me in the right direction, and thanks for your courses, they have been of great help for my current project!