This must have been asked before, but after reading here, here, here and here I can\'t extrapolate the relevant parts to make it work. I am revamping an old web fo
Since my situation I only had a few main pages, with cockamamy rules, I found this easier.. To create an "oldaspxcontroller". So I can be sure everything mapped correctly.
//https://www.oldsite.com/topics/travel/page9.aspx
[HttpGet]
[Route("/topics/{topic}/page{oldpagenum}.aspx")]
public LocalRedirectResult TopicWithPage(string topic, string oldpagenum)
{
return LocalRedirectPermanent($"/topics/{topic}?p={oldpagenum}");
}
You may notice I still use pagenum in querystring.. I just think it looks better.. like mysite.com/topics/travel?p=9 I like better than mysite.com/topics/travel/page/9. I am in .Net core 3.1 and it works nice, even recognizes the pattern and the pagenumber..