In the latest MVC preview, I'm using this route for a legacy URL:
routes.MapRoute(
"Legacy-Firefox", // Route name
"Firefox-Extension/", // URL with parameters
new { controller = "Home", action = "Firefox", id = "" } // Parameter defaults
);
The problem is that both of these URL's work: http://mysite.com/Firefox-Extension http://mysite.com/Firefox-Extension/
I only want the second to work (for SEO). Also, when I create a link to that page, the routing engine gives me back a URL without a trailing slash.
This is the code I'm using to generate the link:
<%= Html.ActionLink("Firefox Extension", "Firefox", "Home")%>
I believe can fix the first problem by using an HTTP handler to do a 301 redirect to the URL with the trailing slash. However, I want to link to the URL with the trailing slash, and I'm hoping to not have to hard-code the version with the slash.
Anyone know how to force the route to use a trailing slash?