Set up your content for hierarchical URLs
Kontent.ai offers the flexibility to create any content hierarchy you need and expose that hierarchy in your URLs in several ways. This cheat sheet explores user-friendly approaches to help you choose the best method for your project requirements.
Hierarchical URLs, an alternative to flat URLs, are especially useful for knowledge portals, intranets, and websites with nested content. For example:
- 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, which can improve page rankings.
- User trust: Clean and hierarchical URLs appear more professional and trustworthy.
- Improved usability: Users can navigate easily and understand their location within the site, enhancing the overall user experience.
- Contextual relevance: Hierarchical URLs provide context about the page content, helping users predict what to expect.
- Data analysis: Hierarchical URLs make it easier 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, SEO goals, and the comfort level of your content creators when choosing the best method for implementing hierarchical URLs in Kontent.ai.
Approach A: Use Live Preview for content hierarchy and URL generation
Live preview lets content creators see their content changes directly within content items, providing an in-context visual of your website structure while editing in real time. By using live preview, you can also manage your website’s information architecture as a hierarchical tree. 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
Add a text element to each content item where the full relative URL path is manually specified. Your web app uses this exact value directly when generating URLs.Pros | Cons |
|
|