Custom routes with virtual paths
Can someone please assist, I've been doing a lot of research on how to get this to work, but can't seem to get it to work. I have the same issue as David here : www.sitefinity.com/.../url-routing
The problem is when adding custom routing that I get a 404 error, but I am sure its because the page does not exists, its a virtual page created via the backend of Sitefinity with a custom usercontrol on the page handling the logic.
How can I handle custom routes in Sitefinity 6?
I have this :
When I search for "Shoes" on this page it needs to display as :
So what I wanted to do was create custom routes for this, but I can't seem to get this to work.
I tried this :
protected void Application_Start(object sender, EventArgs e)
Telerik.Sitefinity.Abstractions.Bootstrapper.Initialized += new EventHandler<Telerik.Sitefinity.Data.ExecutedEventArgs>(Bootstrapper_Initialized);
public class CustomHttpHandler : IRouteHandler
public CustomHttpHandler(string virtualPath)
this.VirtualPath = virtualPath;
public string VirtualPath get; private set;
public IHttpHandler GetHttpHandler(RequestContext requestContext)
var page = BuildManager.CreateInstanceFromVirtualPath(VirtualPath, typeof(Page)) as IHttpHandler;
public bool IsReusable
get return false;
void Bootstrapper_Initialized(object sender, Telerik.Sitefinity.Data.ExecutedEventArgs args)
if (args.CommandName == "RegisterRoutes")
var routes = ((EnumerableQuery<RouteBase>)args.Data).ToList();
routes.Insert(0, new System.Web.Routing.Route("blog/category/Category", new CustomHttpHandler("/blog")));
You can take a look on the similar issue discussed in that forum thread:
Thank you Svetoslav,
We ended up to go a different route because of this issue. For those who have trouble with this, for us it work by adding additional URL's to the specific page, and then redirecting to the additional url.