0
votes

I'm trying to deploy a MVC 3 site to IIS 7.5. The deafult route works but all links return a 404 error including if I manually enter the link for the homepage.

Details:

  • MVC 3 to IIS 7.5
  • Windows Server 2008 R2
  • MVC 3 is installed on server
  • Default Web Site/PaedPhysiotherapy_Uat
  • .net 4 is installed
  • DeafultApplicationPool used
  • App pool is .net4 and running in integrated mode
  • Custom error are turned off

If I deploy to a new website on the same IIS box using different ports, e.g. "http://newsite:81 which not under the default website everything works fine.

2

2 Answers

1
votes

Even in the absence of routing, IIS will redirect requests for "/" to "/Default.aspx". In an MVC app, there's a Default.aspx which manually finds the MVC handler and invokes it. So that's probably why your home link works.

Your other pages must go through routing. In integrated mode there must be an IIS handler for this. Check the ExtensionlessUrlHandler in the IIS handler mappings. Compare that and other handlers with the sites which work.

0
votes

At a guess, if this works when deploying to the root of a site then it looks like an absolute path has sneaked in. Perhaps somewhere this is a missing ~ in front of a path e.g.

/MyController

instead of

~/MyController

Also, you did remember to convert /PaedPhysiotherapy_Uat to an application?