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
GETrequest. - 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:
- Go to Settings > Web and Http > Redirects
- Click + New redirect
- Configure:
- Path: The virtual URL (e.g.
news). The redirect will apply tohttps://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
- Path: The virtual URL (e.g.
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.
External link redirect
- Rule:
/docs→https://helpcenter.example.com - Requests:
/docs→https://helpcenter.example.com
Useful when moving documentation or resources outside of the DW10 solution.
Website-specific redirect
- Rules:
/contact(forwebsite.com) →/support/contact/contact(forwebsite.dk) →/support/kontakt - Requests:
website.com/contact→/support/contactwebsite.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*(forwebsite.dk) →/support/kontakt/kontakt*(forwebsite.com) →/support/contact - Requests:
website.dk/kontakt→/support/kontaktwebsite.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:
- Do not overuse Redirects – Each redirect is a DB lookup. Thousands of entries can slow down request handling
- Do not use as navigation system – Redirects are for exceptions, not core navigation
- Avoid slow notification subscribers – The
OnNoRedirectevent fires on every 404 (often 80–90% of traffic). Slow code here can destabilize the site - Do not return 200 responses in redirect notifications. Use a custom middleware if you need this
- Avoid redirect loops –
/a→/band/b→/awill cause infinite loops