Note: Custom Preview URLs is a plan-based feature and may not be available to all users. Contact Contentstack support for more information.
Custom Preview URLs allow you to define dynamic, pattern-based paths for Live Preview. These paths align preview behavior with your website’s routing logic, including nested routes, taxonomies, multiple domains, and non-native URL fields.
By enabling Custom Preview URLs, you can generate preview URLs dynamically using custom patterns and contextual data.
Note: Custom Preview URLs are currently supported only for Live Preview.
Previously, Live Preview used a fixed pattern:
<environment base URL> + <entry's native URL field>This approach works for simple scenarios but does not support advanced routing setups.
Use Custom Preview URLs when:
Custom Preview URLs resolve the final preview URL through the following phases:
To configure Custom Preview URLs, log in to your Contentstack Account and perform the following steps:

Tip: Use aliases to preview the same content across multiple domains or brand-specific hostnames.


Tip: Use {{entry.<field_uid>}} to access any field dynamically, including nested reference fields.
Note: If multiple configurations exist, Live Preview evaluates them in order and applies the first matching configuration.
Use the URL Test Console to validate your configuration:
This helps identify issues early and ensures that patterns resolve as expected.
Use the Advanced Config section to define transformations and fallback logic through a guided UI.
You can:
The UI generates the configuration automatically, reducing the need for manual JSON editing.
Use advanced configuration when preview URLs depend on transforming or normalizing field values before constructing the final URL.
Supported operations include:
Custom Preview URLs support a wide range of routing scenarios, from simple paths to complex, data-driven URL structures.
Use routing patterns to define URL structures based on entry fields and static path segments. This approach is useful when your website follows predictable URL hierarchies, such as blogs, product pages, or category-based navigation.
Define nested paths using multiple entry fields.
Pattern Example:
/blog/{{entry.category}}/{{entry.slug}}Example Entry:
{
"category": "food",
"slug": "ramen-recipe"
}Result:
/blog/food/ramen-recipe
This approach helps create clean, hierarchical URLs that reflect your content structure.
Add static segments to enforce consistent URL structures.
Examples:
/shop/product/{{entry.slug}}
/blog/{{entry.slug}}-{{locale}}Use taxonomy and data-driven URLs when your routing depends on classification systems such as categories, regions, or tags. This approach helps you generate consistent URLs dynamically without duplicating content across multiple structures.
Use taxonomy values to dynamically construct both domain and path-based URL structures. This is useful for scenarios such as region- or market-specific routing without duplicating content.
Pattern Example (Path-based):
/articles/{{taxonomy:category}}/{{entry.slug}}Pattern Example (Domain + Path):
https://{{taxonomy:region}}.example.com/articles/{{taxonomy:category}}/{{entry.slug}}Result:
/articles/technology/cloud-computing/ai-revolution
https://us.example.com/articles/technology/cloud-computing/ai-revolutionThis approach enables:
Fallback values can be applied when taxonomy data is missing, ensuring URLs remain valid and consistent.
Use dynamic parameter-based URLs when your routing relies on system-generated or custom identifiers, such as entry IDs or external reference values. This is useful for applications that require stable, ID-driven URL structures.
Examples:
/news/{{entry.uid}}
/articles/{{entry.article_id}}/{{entry.slug}}Use localization and environment-based URLs when your content needs to adapt across locales or environments. This approach helps you dynamically construct URLs for multilingual sites or environment-specific previews without hardcoding values.
Position locale codes anywhere in the URL.
Examples:
/{{locale}}/blog/{{entry.slug}}
/blog/{{locale}}/{{entry.slug}}
/blog/{{entry.slug}}-{{locale}}Dynamically resolve URLs without hardcoding environments.
Example:
https://{{environment}}.example.com/{{locale}}/{{entry.slug}}Use multi-domain and host-based URLs when you need to preview the same content across different domains or brand-specific hostnames. This is especially useful for multi-brand, regional, or localized deployments.
Preview the same content across multiple domains using aliases.
Examples:
example.com
example.co.inThis is useful for multi-brand, regional, or localized websites.
Use transformations to standardize and sanitize URL values generated from entry data. This ensures that URLs remain consistent, readable, and optimized for SEO, even when source data contains special characters or inconsistent formatting.
Use transformations to clean and standardize values.
Example:
/recipes/{{entry.title}}Transforms:
"Crème Brûlée" → /recipes/creme-brulee
Advanced Config JSON:
{
"fields": {
"entry.title": {
"operations": [
{ "type": "lowercase" },
{
"type": "regex",
"config": {
"pattern": "[àáâãäåæ]",
"replace": "a"
}
},
{
"type": "regex",
"config": {
"pattern": "[èéêë]",
"replace": "e"
}
},
{
"type": "regex",
"config": {
"pattern": "[ìíîï]",
"replace": "i"
}
},
{
"type": "regex",
"config": {
"pattern": "[òóôõö]",
"replace": "o"
}
},
{
"type": "regex",
"config": {
"pattern": "[ùúûü]",
"replace": "u"
}
},
{
"type": "regex",
"config": {
"pattern": "[ñ]",
"replace": "n"
}
},
{
"type": "regex",
"config": {
"pattern": "[ç]",
"replace": "c"
}
},
{
"type": "regex",
"config": {
"pattern": "\\s+",
"replace": "-"
}
},
{
"type": "regex",
"config": {
"pattern": "[^a-z0-9-]",
"replace": ""
}
},
{
"type": "regex",
"config": {
"pattern": "-+",
"replace": "-"
}
},
{
"type": "regex",
"config": {
"pattern": "^-|-$",
"replace": ""
}
}
]
}
}
}Convert values into predefined formats.
Example:
{{entry.topic}} → ai (from "Artificial Intelligence")
Advanced Config JSON:
{
"fields": {
"entry.topic": {
"operations": [
{
"type": "map",
"config": {
"Artificial Intelligence": "ai",
"Machine Learning": "ml",
"Cloud Computing": "cloud",
"Data Science": "data-science"
}
}
]
}
}
}Use custom field-driven URLs when you need full control over URL generation. This approach allows you to define complete URLs within structured fields, making it suitable for highly customized routing logic.
Use structured fields to define complete URLs dynamically.
Example:
{{entry.customUrl[environment][locale]}}This enables full control over URLs across environments and locales.
Use advanced dynamic URLs when your routing requires combining multiple fields and transformations. This approach helps generate complex, multi-level URL structures that reflect detailed content relationships.
Combine multiple fields with transformations to generate rich URL structures.
Example:
/{{entry.content_type}}/{{entry.category}}/{{entry.topic}}/Result:
/blog-article/technology/agent-os/ai/
Fallback and error handling ensure that preview URLs continue to work even when data is missing or patterns fail to resolve. This helps maintain a consistent preview experience while clearly surfacing configuration issues.
Live Preview handles URL resolution failures through a combination of defaults, error feedback, and fallback behavior.
Resolution Flow:
<base URL> + <entry URL field>This layered approach ensures that:
To ensure scalable, accurate, and maintainable custom preview configurations, follow these best practices:
Custom Preview URLs provide control over how preview URLs are generated in Live Preview. This is especially useful for complex routing, multi-domain setups, and dynamic URL structures.
Combine pattern-based configuration with optional transformations to create scalable and consistent preview experiences across content types, locales, and environments.