Handling URL Path and Story slug
How the URL path determines the story slug
Routing is often one of the first things developers overcomplicate when building a website with a headless CMS.
In reality, Storyblok allows you to keep routing extremely simple.
The idea is straightforward:
The URL path determines the story slug.
With this single principle, you can handle:
simple pages
nested pages
multilingual websites
non-Latin URLs with transliteration
All with the same routing logic.
No complex configuration.
No custom routing layers.
Just a predictable structure that mirrors your Storyblok content tree.
Let’s break it down step by step.
Level 1: Simple path = Simple slug
URL
yoursite.com/aboutSlug
/aboutWhat happens
The application reads the URL path and fetches the story with slug /about using the Content Delivery API.
Routing logic
Get the URL path
Use it as the slug
Fetch the story
That’s it. This is the most basic and clean routing approach you can implement with Storyblok.
Level 2: Nested paths = Nested folders
URL
yoursite.com/about/companySlug
/about/companyWhat happens
The application fetches the story /about/company.
Why this works
Storyblok organizes content in folders and stories that naturally mirror a website structure.
So if your content tree looks like this:
about
└── companyThe URL automatically matches the slug.
Routing logic
Exactly the same as before
read path
use as slug
fetch story
No additional logic required.
This makes the routing system scalable by default.
Level 3: Multilingual Routing
Now let’s introduce languages.
URL
yoursite.com/en/somethingLanguage
enSlug
/somethingWhat happens
Fetch the story with:
slug: /something
language: en
API call: /stories/something?language=enRouting logic
Split the URL path
First segment = language
Remaining path = slug
Fetch the story with the language parameter
This allows you to manage multiple languages in Storyblok while keeping URLs clean and consistent.
URL path structure example
You have two options for multilingual slugs:
1. Same slug for all languages
/en/about
/de/about
/it/aboutStory slug stays the same in every language
Only the content is translated
2. Translate the slug per language (via Translatable Slug application)
/en/about
/de/ueber-uns
/it/chi-siamoSlug itself is translated to match the language
Provides fully localized URLs that are SEO-friendly
Both approaches work seamlessly with Storyblok’s routing model. You choose based on your SEO and localization needs.
Level 4: Transliteration for Non-Latin URLs
Some languages use non-Latin characters in URLs.
URL
yoursite.com/ru/продатьLanguage
ruURL segment
продатьTransliterated slug
/prodatWhat happens
Fetch the story with:
slug: /prodat
language: ruRouting logic
Split URL
First segment = language
Remaining path = transliterated to Latin
Use transliterated value as slug
Fetch the story
This approach allows:
clean URLs in local languages
consistent Latin slugs in Storyblok
predictable routing logic
It keeps the content structure stable while supporting global audiences.
Transliteration Reference
Non-Latin characters in the URL are converted to their Latin equivalents for the slug:
URL path | Language | Transliterated slug |
|---|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
Tool: https://yf-hk.github.io/transliteration/
The Core Principle
The entire routing system can be summarized in one simple flow.
┌─────────────────────────────────────────────────────┐
│ URL PATH │
│ yoursite.com / [lang] / [path...] │
└──────────────┬──────────────────┬───────────────────┘
│ │
┌────▼───-─┐ ┌───────▼────────┐
│Language │ │ Slug │
│parameter │ │ (transliterate │
│(optional)│ │ if needed) │
└────┬─────┘ └───────┬────────┘
│ │
┌──────▼──────────────────▼──────┐
│ Content Delivery API call │
│ GET /stories/[slug]?lang=[ln] │
└────────────────────────────────┘One routing rule. All scenarios covered.
Why This Approach Works Well with Storyblok
This routing model fits perfectly with Storyblok’s architecture.
Content structure mirrors URLs: Folders and stories naturally define the URL structure.
Language is handled via parameters: No need for complex routing configurations.
Slugs stay consistent: Even with multilingual and non-Latin content.
Frontend stays simple
Your application only needs:
path parsing
optional language detection
API request
Nothing more.
Final Takeaway
If you remember one thing, remember this:
In Storyblok, the URL path should define the story slug.
Everything else builds on top of this rule.
Simple pages → path equals slug
Nested pages → folders match URL
Multilingual → first segment is language
Non-Latin URLs → transliterate and fetch
One rule.
Minimal routing.
Maximum scalability.