0

Right now I'm working in a software developed by another programmer who it's no longer part of the project anymore, he send the complete source code of the project.

The thing is, that in some points he make calls to asp pages whithout the extension '.aspx', and this work perfectly fine on the server (Virutal Machine on AWS with Windows Server 2019 and IIS 10), but on my local machine, it gaves me an 404 error, everytime that finds this kind of redirects whithout the properly extension.

Login1.DestinationPageUrl = "./CPersonalRegister" <--- this works perfectly fine on the server, but not on my local machine.

I dont know what other configuration i could search for, or if it's somethind wrong with the IIS.

The used .net framework is 4.0

  • 1
    He probably forgot to show you the rewrite rules, https://www.smarterasp.net/support/kb/a356/how-to-remove-aspx-extension-using-iis-rewrite.aspx – Lex Li Aug 23 '22 at 18:54
  • Try using failed request tracing to see details about 404 error. – samwu Aug 24 '22 at 02:18

1 Answers1

1

Most sites (at lest for a very long time) have what is called Friendly URL's turned on.

This means that URL's look a lot nicer, and you don't have to include the .aspx extension for each page you navigate to.

Probably the most easy way to setup this to to nuget the package "friendly" url's.

This one - even for a asp.net webforms site should work:

enter image description here

So, starting from vs2010, "friendly" URLS should have been installed for your given project.

but, give the above a try. (make a backup copy before you do this, since it sounds like you not heard of this "basic" and "often" used feature of asp.net sites for the last 13+ years).

There is also a step by step floating around on how you can add the bits and parts manually, but nuget package above should do the trick for you.

Albert D. Kallal
  • 42,205
  • 3
  • 34
  • 51
  • Yes, that was, actually i'm testing this project and the first error founded was about the global.asax and an undefined type error on the temporary files created by the app, the temporary solution that we used just to see the execution of the program was delete the global.asax file. and now that i'm reading it again, the routes are been configured in this file, so there it is the redirect error, now i need to find the solution to the original problem. thank you so much – Eugenio Escobar Aug 24 '22 at 17:27