Wednesday, September 21, 2011

Routing does not work on a fresh IIS 7 installation

In a project I am working on we make use of the Routing feature in ASP.NET to get friendly URL for a page. This has been working great on the dev machine in IIS 7 but when deploying it to a new Windows Server machine with IIS 7 the routing part did not work at all, so something was different between the two environments.

The solution was as simple as installing the HTTP Redirection module in IIS.

  1. Open the Server Manager.
  2. Choose Web Server (IIS) and scroll down to Role Services.
  3. Click Add Role Services and click the checkbox next to HTTP Redirection.
  4. Click Next and Install, and you are done!