Table of Contents

Redirects

How to setup redirects in your DW10 solution

The Redirects tool lets you add virtual URLs (or direct paths) to your solution. These are alternative paths that do not physically exist in your site structure but should lead visitors to a specific destination. For example, you can create a redirect from /old-url to /new-url. This is useful for keeping links alive after restructuring content, migrating from older systems, or creating short memorable URLs for campaigns.

Why Use Redirects?

  • SEO preservation: Keep your Google ranking when URLs change
  • Migration safety net: When moving from DW9 to DW10 or restructuring navigation
  • User experience: Prevent broken links after renaming or merging content
  • Campaigns: Create short, memorable URLs without needing physical pages

Redirects are handled by a middleware component in the ASP.NET Core pipeline (RedirectHandlerMiddleware). This middleware is placed late in the request pipeline, so it only executes if no other handler (such as a PageView) has matched the request.

The middleware checks:

  • The request must be a GET request.
  • The requested path must not be a static file (except .aspx).
  • The path must not be inside /files/ (for performance and security reasons).

It then tries several candidates for matching:

  • The encoded URL (e.g. /h%C3%B8me)
  • The decoded URL (e.g. /høme)
  • With or without query strings

If a match is found in the UrlPath database table, the middleware issues a 301 permanent redirect to the configured target URL. All redirects in DW10 are permanent (301).

Note

Advanced Considerations

  • Redirects increment a visits counter every time they are used
  • Redirects can be scoped by language area/website (AreaID)
  • If a real file or page exists at the same path, the redirect will not trigger

Creating redirects via the UI

To create a redirect via the UI:

  1. Go to Settings > Web and Http > Redirects
  2. Click + New redirect
  3. Configure:
    • Path: The virtual URL (e.g. news). The redirect will apply to https://yourwebsite.com/news
    • Redirect to: Choose an internal page, an external link, or another path
    • Website: Optionally restrict the redirect to one website/hostname if multiple sites share the same path
    • Active: Toggle whether the redirect is active

Examples

Simple path redirect

  • Rule: /about/company/profile
  • Requests: /about/company/profile

This is a straightforward redirect from one path to another, often used after renaming or restructuring content.

  • Rule: /docshttps://helpcenter.example.com
  • Requests: /docshttps://helpcenter.example.com

Useful when moving documentation or resources outside of the DW10 solution.

Website-specific redirect

  • Rules: /contact (for website.com) → /support/contact /contact (for website.dk) → /support/kontakt
  • Requests: website.com/contact/support/contact website.dk/contact/support/kontakt

Redirects can behave differently depending on the hostname, allowing you to tailor per-site behavior.

Wildcard Examples

Simple section redirect

  • Rule: /blog*/articles
  • Requests: /blog/articles /blog/2025/articles /blog/2025/january/articles

Specific subpath overrides generic redirect

  • Rules: /products*/shop /products/shoes*/shop/footwear
  • Requests: /products/shop /products/bags/shop /products/shoes/sneakers/shop/footwear

Language-specific redirects

  • Rules: /kontakt* (for website.dk) → /support/kontakt /kontakt* (for website.com) → /support/contact
  • Requests: website.dk/kontakt/support/kontakt website.com/kontakt/support/contact

Catch-all campaign redirect

  • Rule: /black-friday*/campaigns/black-friday-2025
  • Requests: /black-friday/campaigns/black-friday-2025 /black-friday/deals/campaigns/black-friday-2025

Dangerous misconfiguration (what not to do)

  • Rule: /*/home
  • Requests: /about/home /products/home /support/home

This will catch everything and break navigation. Avoid creating global catch-all redirects.

What not to do

Please heed the following warnings:

  1. Do not overuse Redirects – Each redirect is a DB lookup. Thousands of entries can slow down request handling
  2. Do not use as navigation system – Redirects are for exceptions, not core navigation
  3. Avoid slow notification subscribers – The OnNoRedirect event fires on every 404 (often 80–90% of traffic). Slow code here can destabilize the site
  4. Do not return 200 responses in redirect notifications. Use a custom middleware if you need this
  5. Avoid redirect loops/a/b and /b/a will cause infinite loops
To top