# Routing 404s issues

**URL:** <https://forum.ghost.org/t/routing-404s-issues/29434>\
**Category:** Routing\
**Created:** [April 6, 2022, 1:10am UTC](https://forum.ghost.org/t/routing-404s-issues/29434 "2022-04-06T01:10:54Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![csgeek](https://avatars.discourse-cdn.com/v4/letter/c/9de053/32.png) [@csgeek](https://forum.ghost.org/u/csgeek)\
**Post date:** [April 6, 2022, 1:10am UTC](https://forum.ghost.org/t/routing-404s-issues/29434/1 "2022-04-06T01:10:54Z")

</div>

I have some custom routes defined as follows. My issue is that IF the post doesn’t have a tag it returns a 404, and if I have a new tag created that isn’t part of the routes.yaml it also 404s.

```nohighlight
routes:
  /signup/: members/signup
  /signin/: members/signin
  /account/: members/account
  /:
    data:
      post:
        resource: pages
        type: read
        slug: landing
    template:
      - custom-home
  /posts/:
    controller: channel
    template: index

collections:
  /announcements/:
    permalink: /announcements/{slug}/
    template: index
    filter: tag:announcements
  /gaming/:
    permalink: /gaming/{slug}/
    template: index
    filter: tag:gaming

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

```

Is it possible to have custom routes for some tags, and everything else to still work via /{slug} path?

---

<div class="post-metadata">

**Author:** ![brightthemes](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/brightthemes/32/25099_2.png) [@brightthemes](https://forum.ghost.org/u/brightthemes)\
**Post date:** [April 6, 2022, 7:16am UTC](https://forum.ghost.org/t/routing-404s-issues/29434/2 "2022-04-06T07:16:08Z")

</div>

This is because posts have to belong to a collection to have the `{slug}` as URL.  
In your case, anything that doesn’t have the `announcements` or `gaming` tag will not belong to a collection.

You could set up your routes in a different way, have the `/posts/` as the collection without filter, and the `/announcements/` & `/gaming/` as channels.

See the topic below:

> [@Broken Post URL for Featured Posts](https://forum.ghost.org/t/broken-post-url-for-featured-posts/22885/2):
>
> Collections change the URL of a post, if a post isn’t included in a collection then it has no URL which I think is what you are seeing. It sounds like you may want to leave the default collection alone and use a channel for your homepage instead? https://ghost.org/docs/themes/routing/#channels

---

<div class="post-metadata">

**Author:** ![Kevin](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/kevin/32/32_2.png) [@Kevin](https://forum.ghost.org/u/Kevin)\
**Post date:** [April 6, 2022, 1:10pm UTC](https://forum.ghost.org/t/routing-404s-issues/29434/3 "2022-04-06T13:10:58Z")

</div>

> [@csgeek](#):
>
> Is it possible to have custom routes for some tags, and everything else to still work via /{slug} path?

Yes, you need to keep the default collection with your other tags excluded, eg:

```yaml
collections:
  /announcements/:
    permalink: /announcements/{slug}/
    template: index
    filter: tag:announcements
  /gaming/:
    permalink: /gaming/{slug}/
    template: index
    filter: tag:gaming
  /:
    permalink: /{slug}/
    template: index
    filter: tag:-[announcements,gaming]

```

---

<div class="post-metadata">

**Author:** ![csgeek](https://avatars.discourse-cdn.com/v4/letter/c/9de053/32.png) [@csgeek](https://forum.ghost.org/u/csgeek)\
**Post date:** [April 6, 2022, 3:15pm UTC](https://forum.ghost.org/t/routing-404s-issues/29434/4 "2022-04-06T15:15:36Z")

</div>

Thank you @Kevin. That works great.
