302 Redirect in Umbraco with umbracoRedirect Routing Property

The umbracoRedirect property in Umbraco CMS allows you to create 302 Temporary Redirects directly within content nodes. Using a Content Picker, you can define a destination, and when a user navigates to the original content node, they are automatically redirected to the specified page. This guide will show you how to implement this using a practical example with the existing Content Page document type from the Umbraco Starter Kit.

What is umbracoRedirect?

The umbracoRedirect property is a reserved property alias in Umbraco CMS that enables you to configure temporary redirects for content nodes. It simplifies URL management without requiring external tools or manual configuration.

Key Features:

  • Simple to configure.

  • Ideal for handling temporary redirects.

  • Fully integrated into the Umbraco routing pipeline.

  • Built-in feature that doesn't require additional plugins or custom code.

Example Use Cases:

  • Redirecting outdated content to new pages.

  • Handling URL restructuring during website updates.

  • Simplifying navigation for marketing or SEO purposes.

Practical Example: Redirecting a Deprecated Page

Imagine your website has an old page /summer-deals-2025/ that you want to redirect to a new page /summer-deals-2026/.

Here's how you can do it:

  1. Create a new content node or identify an existing one for Summer Deals 2026.

  2. Use the umbracoRedirect property in the Summer Deals 2025 node to select the Summer Deals 2026 page as the destination.

  3. Publish Summer Deals 2025 node.

When users visit /summer-deals-2025, they are redirected automatically to /summer-deals-2026.

Magic! Let's go into more technical detail to clarify what else you must do.

Umbraco Redirect Document Type Property

Extending an existing Umbraco document type by adding a new umbracoRedirect property with a Content Picker

Step 1: Add the umbracoRedirect to the Content Page Document Type#

In this example, we'll use the Umbraco Starter Kit and modify the existing Content Page document type. However, you can apply the same approach to any page or document type in your system.

In the Umbraco Backoffice, go to the Settings section.

Locate the Content Page document type.

Add a new property for redirection in the Document Type editor:

  • Property Name: Umbraco Redirect

  • Alias: umbracoRedirect

  • Editor: Content Picker

Save and close the Document Type editor.

💡Pro Tip: It's worth adding a clear field description for your editors, for example, "Select the page you want visitors to be redirected to when they access this content. This creates a temporary (302) redirect, guiding users seamlessly to the chosen destination without showing this page's content."

Step 2: Create Content Nodes

Navigate to the Content section in the Umbraco backoffice.

You'll need to create two nodes:

  1. Redirect Source: Create a new node using the Content Page document type. Name it something like Summer Deals 2025.

  2. Redirect Target: Create or identify an existing content node to serve as the destination (e.g., Summer Deals 2026).

Redirect Source (Content Page) - Summer Deals 2025

Redirect Source (Content Page) - Summer Deals 2025

Redirect Source (Content Page) - Summer Deals 2026

Redirect Target (Content Page) - Summer Deals 2026

In the "Umbraco Redirect" property of the Summer Deals 2025 node, use the Content Picker to select the destination page (e.g., Summer Deals 2026).

 

Setting Redirect Page in Umbraco

Setting Redirect Page in Umbraco

Publish source node.

Step 3: Verify the Redirect#

Navigate to the URL of the Summer Deals 2025 node.

The browser should automatically redirect to the selected destination.

Use developer tools to confirm the HTTP status code is 302 Temporary Redirect.

DevTools: Summer Deals 2025 Page is Redirected to Summer Deals 2026 Page

DevTools: Summer Deals 2025 Page is Redirected to Summer Deals 2026 Page

Troubleshooting Common Issues

Redirect Not Working

  • Check the Alias: Ensure the property alias is exactly umbracoRedirect.
  • Verify Publishing: Confirm that the redirect and target nodes are published.

Infinite Redirect Loop

Avoid setting the umbracoRedirect property to redirect to itself or a circular chain of nodes.

Target Page Not Loading

Ensure the target page is accessible and not restricted by permissions or unpublished.

 

💡Further reading

Special Property Type aliases for routing - https://docs.umbraco.com/umbraco-cms/reference/routing/routing-properties

↑ Top â†‘