Flatten all urls

I dont like the idea to use urls like /foo/bar/baz if I’ve such structure. I would prefer to have simple and short urls like /baz because im using breadcrumbs to show the hierarchy of my site. How do I solve this problem with kirby? Is there a way to flatten all urls? Don’t get me wrong, I like to structure my files and folders this way but I dont like use such long urls then. I know there is an example to hide /blog to accomplish my idea, but I’m asking for a way which works on all my urls. Thanks in advance! =)

Structuring the content on one hand and flattening it on the other hand can break your site very quickly. Just imagine you create a page with the same slug in two different directories (which would normally not be possible) and you end up with two pages that have to argue which one is responsible to be shown to the user. :smiley:
That’s very hard to debug.

If you already have a breadcrumb navigation, it makes sense to show the structure of your site in your URLs as well. Some users (including me) use the URL a lot to find out where they are on the site and if a user finds a page using a search engine, they also immediately know where they will end up if they click the link.

1 Like

Take a look: http://getkirby.com/docs/toolkit/routing

@lukasbestle The reason I wanna go flat: It is easier to restructure content afterwards without loosing linkjuice (doing a 301 redirect). I tell search engines via schema.org markup about my structure, so I can have super short urls, ez to remember and still maintain a good hierarchy for both.

@ahmetbora I know about this page. I would love to see some samples though.

I personally have never needed to restructure content. The structure of a site should always be the first task before building the site.

1 Like

In a perfect world, sure. With modern “content developing” it is the same as with software. You want to be agile without waiting for all features to be done first. Otherwise you would have to hold back all your information till your content is “ready” - a deal breaker. People need information now. Content is growing meanwhile.

You seem to be speaking of rather large sites with a varying structure (a lot of different content types and locations). Content architecture becomes even more important in such situations. But anyway: You will reach the limit of unique page URLs even faster.