Skip to content
Grav 2.1 is out: every page speaks Markdown. Read the announcement →

Routing taxonomy urls

Started by Scott Rod 8 years ago · 2 replies · 1110 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 blu3prince, 4 days ago
1 76 9 hours ago
Support · by complanar, 7 days ago
6 161 2 days ago
Support · by Rick Beebe, 7 days ago
2 121 4 days ago
Support · by alex, 5 days ago
2 103 4 days ago
Support · by Marcel, 2 weeks ago
1 155 5 days ago