Skip to content
Grav 2.0 is officially stable. Read the announcement →
Support

Routing taxonomy urls

Started by Scott Rod 8 years ago · 2 replies · 953 views
8 years ago

Newbie question. Is there a way to have all taxonomy permalinks follow this logic…
By default, Grav displays all blog posts in the manner of /blog/taxonomy:term

For example:

https://myname.host/blog/category:music

But, is it possible for the url to be:

https://myname.host/blog/category/music

I've tried looked through the documentation and I'm still dumfounded.
https://learn.getgrav.org/content/routing

6 years ago

Hi @all,

i have the same question as scottrod. Is it possible to rewrite the default taxonomy URL structure?

Thanks!

6 years ago

Setting a Regex based route like:

TXT
routes:
  '/(.*):(.*)': /$1/$2

should work but it doesn't.

It could be caused by Grav using a colon in "Grav style" URL parameters, for example my-page/query:something. Replacing the colon for a directory separator clearly would render this style useless.

Personally I would be happy to give up on the "Grav style" (and fall back to my-page?query=something) in favor of being able to reroute as requested in this post.

Suggested topics

Topic Participants Replies Views Activity
Support · by Thomas, 1 week ago
3 96 5 hours ago
Support · by Anna, 3 days ago
2 95 1 day ago
Support · by Justin Young, 1 day ago
1 64 1 day ago
Support · by Duc , 1 week ago
2 100 6 days ago
Support · by Colin Hume, 1 week ago
2 92 6 days ago