[Question] Change permalink give my page 404

Hi guys. Let say i have the taxonomies call ‘author’ and im config like this

   author = 'tacgia'

It working with tacgia : http://localhost:1313/tacgia/the-cookie-monster/
But i want to make my link had slug. So i changed it to tac-gia by using `Permalink’ in config.toml

  tacgia = '/tac-gia/:slug'

So the url is http://localhost:1313/tac-gia/the-cookie-monster/
But i have 404 result. Can anyone explain what happend?
Im following to this posts too. But it still give 404


I have mine setup like this:

channel = "channels"
category = "categories"
tag = "tags"
categories = "/cat/:slug/"
tags = "/tag/:slug/"
channels = "/channels/:slug/"

My folder hierarchy:


Then in the _index.md file:

title = "Public Domain"
aliases = ["/tag/public-domain"]
url = "tag/publicdomain"
translationKey = "tag-public-domain"
title = "공개 도메인"
aliases = ["/ko/tag/public-domain", "/ko/tag/publicdomain"]
#url = "tag/publicdomain"
translationKey = "tag-public-domain"

So I think you need to check your folder structure and add an _index.md file, something like: /blog/tacgia/{term}/_index.md. Using your example, it would be: /blog/tacgia/cookiemonster/_index.md.

Then in your _index.md file:

title = "The Cookie Monster"
#aliases = [""]
url = "tac-gia/the-cookie-monster"
#translationKey = ""

If I may, you can keep the “plural” intact to make things unified in your config, like so:

author = 'authors'

authors = '/tac-gia/:slug/'

If you do the above, then your folder structure should be: /blog/authors/{term}/_index.md.

Lastly, but not the least, do not use hyphens, spaces, underscores, in your taxonomy folders. Condense it into one word and just add an _index.md file per term to manipulate the URL of your terms.

Then in your frontmatter of your post/article, you reference it as that onewordterm. For example:

authors = ["cookiemonster"]

See if it works.

P.s. I’m not sure if it’s hackish but it works for what I need: displaying terms in different languages and changing the taxonomy URL (instead of categories, it’s simply /cat/ by declaring url param in _index.md file for each term). The only catch, I have to add an _index.md file to each term.

I hope it helps.

1 Like

Hey @techmagnus. Im try following your setup and working now. Sorry i was busy 2 days ago. Now i have time to reponese you. . Thanks again. Have a good day

1 Like

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