views:

39

answers:

1

I have this routing setup at the moment

routes.MapRoute(
                "OldPages",          // Route name
                "page{id}.html",     // URL with parameters
                new { controller = "WebPage", action = "Details", pageName = "oldpage", moreInfoID = 0 },
                new { action = "Details" }
                );

I am moving from an old site to my new dynamic site and trapping all old URL's in this route to do a 301 redirect. My old site's pages all start with pageX.html or pageXX.html where X is a number.

My route currently handles this fine but I have just realised that my old site also has a page called index.html so I was wondering if the route can be modified to handle that or will I have to create a new route for just that?

Thanks

+2  A: 

For a one-off, I would add an extra route. If it's something you encounter repeatedly you could use a regular expression route handler or a custom route handler, but those are heavyweight techniques which would be overkill for just a single case.

FinnNk