Custom structured urls

I’ve been trying to create custom url structures for some time now and i’ve been following along this tutorial which i think is great, however im not sure if im going about this the wrong way or this indeed works as intended to.

I basically need to create a page with a list of tagged articles with links to the article. Simple enough.

So let’s say i have mysite.com/engineering as the page with a list
and the article would link to something like mysite.com/engineering/node-js

If i navigate to mysite.com/engineering/node-js it redirects to mysite.com/node-js

How can i get the url to display properly? Is that how content collections work?

my routes.yaml file

routes:
  
collections:
  /:
    permalink: /{slug}/
    template:
      - index
  /engineering/: 
    permalink: /engineering/{slug}/
    filter: engineering+tag
    template:
      - engineering

taxonomies:
  tag: /tag/{slug}/
  author: /author/{slug}/
routes:
  
collections:
  /:
    permalink: /{slug}/
    filter: tag:-engineering
    template:
      - index
  /engineering/: 
    permalink: /engineering/{slug}/
    filter: tag:engineering
    template:
      - engineering

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

If i navigate to mysite.com/engineering/node-js it redirects to mysite.com/node-js

Ghost does not redirect this use case. Did you try clearing your cache?

1 Like

Hey Kate,

Yes i did and i’ve restarted my ghost blog although im working locally.

Running version 2.1.2

Must be a local issue. It works on my machine.
The slug of the post is node-js and it’s tagged with engineering. It will live on /engineering/node-js/.

hmmm… ok. I have a staging version. ill re-implement this on that site instead and post back any valuable discoveries. thanks

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.