Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
I'm looking for a way to redirect all pages under a node without using the template page
so for example opening
will redirect to
will redirect to
Suppose content A needs to redirect to Content B.
In that case, you need to modify the document type of A and add new property: umbracoRedirect of type content picker.
Then on content A, you need to select content B on the redirect field. This will do a 302 redirect.
You can also use: umbracoInternalRedirectId of type content picker, this will not rewrite the url but will load content B.
See here for more reserved properties from Umbraco
But this will make admin have to put redirect from the cms to everything under the node. Is there no other way? Perhaps modifying the web config?
Then you have to do it in code by creating a filter and use it on application started.
public class ProductRedirectFilter : ActionFilterAttribute
public override void OnActionExecuting(ActionExecutingContext filterContext)
// find more efficient ways to check if url contains products
// use regex to check for string after products/..../.../
filterContext.Result = new RedirectResult("www.domain.com/products");
Add the filter in another class FilterConfig.cs
public class FilterConfig
public static void RegisterGlobalFilters(GlobalFilterCollection filters)
Then on your application started event handler:
public class YourApplication : ApplicationEventHandler
protected override void ApplicationStarted(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
Not tested though, but should work.
will try and update tomorrow at work. Thanks!
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted