etanb
September 24, 2018, 6:45pm
1
Version ghost:1.22.4
Hello,
Currently if you’d like to see all posts of a certain tag you’d have to go to myblog.com/tag/interesting-tag . Is there a way to remove the second slash and make the tag filter url structure look like: myblog.com/interesting-tag ?
Thank you!
1 Like
Oshawk
September 25, 2018, 9:32am
2
A couple of solutions:
Modify the routes.yaml so it looks like this:
routes:
collections:
/:
permalink: /{slug}/
template:
- index
taxonomies:
tag: /{slug}/
author: /author/{slug}/
This would affect all tags and /tag/ urls may not work any more.
Put something like this in the redirects.json:
[{
“from”: “^\/interesting-tag(\/?)$”,
“to”: “/tag/interesting-tag/”
}]
This will just redirect /interseting-tag to /tag/interesting-tag
https://docs.ghost.org/docs/dynamic-routing
https://docs.ghost.org/docs/redirects
1 Like
etanb
September 25, 2018, 3:08pm
3
This is excellent. Thank you for the knowledge bomb!
etanb
September 27, 2018, 2:18pm
5
The docs say to add this to “content/settings/routes.yaml”
Where is this folder? Within the theme or ghost app itself?
Oshawk
September 27, 2018, 2:20pm
6
If you go to “labs” in the sidebar there is an option to upload it directly at the bottom.
system
Closed
October 11, 2018, 2:20pm
7
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.