Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Nate 143 posts 184 karma points
    Jun 20, 2011 @ 01:29
    Nate
    0

    URL Routing in Umbraco

    I'm trying to setup webforms routing in umbraco.

    I have a content page off the route called "ride".  I'd like to change it from www.mysite.com/ride?id=12345 to www.mysite.com/ride/12345

    I've added the following to a class in the app code folder.

     

    public class Global : umbraco.Global
    {
    
        /// <summary>
        /// Code that runs on application startup
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
    
        protected override void Application_Start(object sender, EventArgs e)
        {
            base.Application_Start(sender, e);
    
            RouteTable.Routes.Add("RideRoute", 
                                    new Route("ride/{RideGuid}", 
                                    new PageRouteHandler("~/ride")));
    
        }
    

     

    But that gives me a 404.

    I've also tried adding ~/ride/ to umbracoReservedUrls umbracoReservedPaths in the web.config

    Does anyone know how to get this to work?

Please Sign in or register to post replies

Write your reply to:

Draft