Set up your content for hierarchical URLs
Kontent.ai gives you enough flexibility to create any content hierarchy you want. You can expose that hierarchy in your URLs in several ways. This cheat sheet explores user-friendly approaches you can consider so that you pick the right one based on your needs.
Hierarchical URLs, an alternative to flat URLs, are great for knowledge portals, intranets, and websites with nested content.
- Hierarchical URLs can look like
/content-model/content-types/introduction
. - Flat URLs can look like
/introduction-to-content-types
.
- Better SEO: Search engines favor descriptive URLs with clear hierarchies, improving page rankings naturally.
- User trust: Clean and hierarchical URLs appear more professional and trustworthy.
- Improved usability: Users can easily navigate the site and understand their location within it, enhancing the overall user experience.
- Contextual relevance: Hierarchical URLs provide context, helping users predict the type of information on a page.
- Data analysis: Hierarchical URLs make it easy to drill down into your web analytics section by section.
Remember that your URL hierarchy doesn’t need to reflect your content hierarchy one-to-one.
Consider your project’s requirements and the comfort level of your content creators when choosing the best method for implementing hierarchical URLs in Kontent.ai.
Approach A: Content and URL hierarchy through Web Spotlight
Use Web Spotlight to manage your website’s information architecture. With this navigation approach, content creators can arrange pages in a hierarchical structure. Your web app then uses this structure to generate hierarchical URLs automatically. You construct hierarchical URLs by using parent-child relationships between content items. Each content item links to a parent item and the web app combines the URL slugs from each level to form the full path.Pros | Cons |
|
|
Approach B: Semi-hierarchical URLs based on content metadata
For semi-hierarchical short URLs, assign a URL prefix based on the content type, such as,/articles/
or /blogs/
, and append the URL slug from each content item. This approach can also work with taxonomies.
Pros | Cons |
|
|
Approach C: Full relative URLs stored in content items
Each content item includes a text element where the full relative URL path is specified manually. Your web app uses this value directly when generating the URL.Pros | Cons |
|
|