I have an instance of Ghost running on DO. Currently, all my post URLs are like this mywebiste.com/post-slug. I want to change it to mywebsite.com/tag/post-slug.
How do I do it?
I have an instance of Ghost running on DO. Currently, all my post URLs are like this mywebiste.com/post-slug. I want to change it to mywebsite.com/tag/post-slug.
How do I do it?
This would be a use case for custom routing.
In particular, you can update your main collection to:
routes:
collections:
/:
permalink: /{primary_tag}/{slug}/
template: index
taxonomies:
tag: /tag/{slug}/
author: /author/{slug}/
Now, a post with the tag special
and slug title
would appear on /special/title.
Thanks, @RyanF this solved my problem. If I want my posts to normally appear as site.com/slug and also as site.com/my_tag/slug, how can I do that?
A post can only have one URL. You can set up a redirect so that one URL redirects to the other, but a post can’t live at both locations. You also likely don’t want to do that because you’d get penalized by search engines, which would see you as having duplicate content.