This results in visits to the default /tag/test/ page redirecting to the /test-pages/ , which is nice.
Unfortunately, it appears that the links created by {{tags}}, e.g. in every post card, still refer to the default link, creating hundreds of links to redirects wherever this technique is used.
Is this right, or am I doing something wrong?
Ideally, {{tags}} would know that itās creating a link to a redirect and just link to the desired path.
The docs on routing explain that uses the data feature is what triggers the redirects you are seeing:
[Using data in a routes file] will assign all of the data from a Ghost page with a slug of team to the new route, and it will also automatically redirect the original URL of the content to the new one. [ā¦] The old URL will redirect to the new one, to prevent the content being duplicated in two places.
If the redirects bother you, maybe using a ācollectionā rather than a āchannelā would be a better fit for you?
See the section on using channels vs collections:
The redirects are there to make sure the hundreds of published links you mentioned donāt break. In your case, it sounds like you are setting up a site for the first time so donāt need that feature.
If you can edit the theme, you could adjust the behavior, if you donāt want to have the 301. (Iām not sure itās worth the effort, but hereās howā¦)
This example (advanced example) shows how to generate the output of the {{tags}} helper.
Instead of using the {{url}} parameter, youād sub in ā/{{slug}}-pagesā, if thatās a common pattern that applies to all your tags.
(You could also use some javascript to rewrite the links, if you need a solution at the code injection level insteadā¦)
Thanks, Cathy. This is not applied consistently to all tags, but maybe there are few enough tags that I can write a conditional to target the ones I need.
I donāt want to use JS because of the SEO implications.