URL Re-writing

Posted by Community Admin on 04-Aug-2018 13:37

URL Re-writing

All Replies

Posted by Community Admin on 08-Nov-2015 00:00

Hi there, 

We are working on a SF feather project (8.1). We need to achieve the following:

1- Overwrite the built-in routing in the CMS, so that we can use our own routing. 

Below is the code that will add our routing, but we are not able to change the routing to be able to change the page name order in the url

We need to achieve the following url Structure 

host/parentContentTitle/ChildContentTitle/pageName 


Here is our code:

void Bootstrapper_Initialized(object sender, Telerik.Sitefinity.Data.ExecutedEventArgs e)
       
            if (e.CommandName == "RegisterRoutes")
           
                RegisterRoutes(RouteTable.Routes);
           
       

private void RegisterRoutes(RouteCollection routeCollection)
       
           // routeCollection.IgnoreRoute("resource.axd/*pathInfo");

            routeCollection.MapRoute(
                "Page",
                "id/Page",
                new controller = "Page", action = "Index", id= UrlParameter.Optional
                );
       

This thread is closed