Skip to content
● Meet Grav Guard: keep every Grav site you run secure and up to date, all from one place. Free for up to 3 sites. Read more →

Routing taxonomy urls

Started by Scott Rod 8 years ago · 2 replies · 1272 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

7 years ago

Hi @all,

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

Thanks!

7 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 TomW, 2 weeks ago
8 228 10 hours ago
Support · by alex, 2 months ago
8 667 1 day ago
Support · by Supple, 5 days ago
1 98 1 day ago
Support · by TomW, 1 week ago
3 160 3 days ago
Support · by TomW, 6 days ago
2 106 6 days ago