Broken post link

I’m using a custom theme for Ghost and I just found out I have a broken link to a post…just one. Everything else is normal. The post shows as featured and on my index page. It only redirects to 404 page. Has anyone experienced something similar? Does anyone know how to fix this?

Here’s the link to the post. If you navigate to my home page and click on “Failure Is The Driving Force Of Improvement” you’ll be able to see what happens.

I tried deleting the post, restarting my server and publishing again…all the same. To me it looks as if the link generated is the one for previewing posts…

I’d really appreciate your help.

Do you have a custom routes.yaml file?

Yes I do. Here it is:

  /signup/: members/signup
  /signin/: members/signin
  /account/: members/account

    controller: channel
    template: home

    permalink: /{slug}/
    template: index
    filter: tag:post
    permalink: /archive/{slug}/
    template: archive
    filter: tag:newsletter

  tag: /tag/{slug}/
  author: /author/{slug}/

You only have collections configured for posts that have either the tag ‘post’ or the tag ‘newsletter’.

Any posts that don’t have one of these tags won’t belong to a collection. A collection is what gives the post a URL.

I’d guess your post doesn’t have either of those tags, and therefore the 404 is expected?

Yes, that’s exactly what it is. This was a stupid mistake. Sorry to bother you with it :sweat_smile:

Thank you

No worries at least it was easy :smiley:

1 Like