I believe the routes install something similar to this:
routes.MapRoute("question-permalink", "q/{questionId}/{userId}",
new { controller = "PermaLinkController",
action = "Question", userId = UrlParameter.Optional },
new { questionId = "[0-9]+", userId = "[0-9]+" });
Based on 302 Foundindicating the current location of the question: I assume that the PermaLink Control Action looks something like this:
public class PermaLinkController : Controller
{
public Question (int questionId, int? userId)
{
Response.RedirectToRoute("question", new { questionId = questionId });
}
}
source
share