core razor legacy url rewrite in Startup.cs (default.asp => /index/...

  • Thread starter Thread starter Jonas100
  • Start date Start date
J

Jonas100

Guest
Hello,


Hello,

like to rewrite a legacy url (default.asp?pageid=A) in .net core web using startup.cs, there:

services.AddRazorPages()
.AddRazorPagesOptions(options =>
{
options.Conventions.AddPageRoute("/newpath/GrabLegacyUrlPage/", "/veryoldpath/default.asp?pageid=10&p=2");

}

These varies cause 404 error too:

options.Conventions.AddPageRoute("/newpath/GrabLegacyUrlPage/", "/veryoldpath/default.asp?");

options.Conventions.AddPageRoute("/newpath/GrabLegacyUrlPage/", "/veryoldpath/default");

options.Conventions.AddPageRoute("/newpath/GrabLegacyUrlPage/", "/veryoldpath/"); is working, but - as you may imagine - not for the default.asp deeplink.

Running out of ideas, asking kindly for help. Anoyone out there who fixed it?

Continue reading...
 
Back
Top