Get in touch 01795 905292

Resolving Redirect URL Issues in Umbraco 8 After Assigning a Culture and Hostname

Resolving Redirect URL Issues in Umbraco 8 After Assigning a Culture and Hostname

When managing multilingual or multi-domain websites in Umbraco 8, it is common to assign a culture and hostname to the root content node. However, doing so can inadvertently disrupt existing redirect URLs, particularly if those redirects were established prior to the hostname configuration.

In this post, we will examine why this occurs and how to resolve it using a straightforward SQL-based approach.

Background

Umbraco stores redirect URLs in the umbracoRedirectUrl table. When content is moved or renamed—or when custom redirect functionality is in use—Umbraco typically creates entries in the format:

/old-page
/old-page

These entries are mapped to a content key that points to the new destination.

However, when a culture and hostname are assigned to the root node, Umbraco alters its behaviour. Redirects are now expected to include the root node's ID as a prefix, resulting in URLs such as:

1058/old-page
1058/old-page

As a result, any redirect URLs stored prior to the hostname change no longer match the expected format and will cease to function correctly.

The Solution

To restore functionality to existing redirects, two SQL updates can be applied:

-- Steps
-- Step 1: Prefix existing redirect URLs with the root node ID (replace 1058 with your actual node ID)
UPDATE dbo.umbracoRedirectUrl
SET url = '1058' + url
WHERE url NOT LIKE '1058/%'

-- Step 2: Recalculate the URL hash to match Umbraco's expected format
UPDATE dbo.umbracoRedirectUrl
SET urlHash = LOWER(CONVERT(NVARCHAR(255), HASHBYTES('SHA1', LTRIM(RTRIM(LOWER(CONVERT(VARCHAR(MAX), url))))), 2))

Important Notes:

  • Ensure you replace 1058 with the actual ID of your homepage or root node.

  • These queries assume all affected redirects require the same node ID prefix.

  • If a culture and hostname are ever removed, the reverse logic applies—you would remove the node ID prefix instead of adding it.

Compatibility

This approach has been validated in Umbraco 8. While the redirect storage model appears similar in later versions, this has not been tested against Umbraco 9+. If you intend to apply this fix to newer versions, confirm that the schema and redirect behavior remain consistent.

Always back up your database before executing direct SQL modifications.

Conclusion

Assigning a culture and hostname in Umbraco can lead to unexpected issues with legacy redirects. Fortunately, with a couple of well-targeted SQL updates, you can restore proper redirect behaviour and ensure a seamless experience for users and search engines alike.

If you have encountered similar issues in newer versions or in more complex multi-site setups, feel free to share your experience or adaptations.

If you need help resolving redirect or other technical issues on an existing Umbraco 8 website, our Umbraco support service can help with immediate fixes. As Umbraco 8 is now end of life, we can also plan and deliver a safe migration to a supported Umbraco version.

Justin Neville

Written by Justin Neville

Justin has worked in software development since 1998. He began writing C and C++ applications, moving to C# and .NET development in 2002. From 2002 to 2013 he built large-scale internal web applications for major companies in the finance and insurance sectors. In 2013, he founded Nevitech IT Solutions Ltd, and since then has focused exclusively on building and supporting websites using Umbraco CMS.

Justin is an Umbraco Certified Master and an Umbraco MVP for 2026. He won the Umbraco AI Package Award for his AI Log Analyser package, contributes to the Umbraco CMS core, and co-organises the Umbraco Kent Meetup. His particular strengths include system architecture, performance optimisation, complex troubleshooting, and writing clean, scalable code. He also mentors junior developers and works closely with agency partners on complex builds requiring specialist expertise.

More articles by Justin