4

I use URL rewriting (HttpContext.Current.RewritePath(...)) inside Global.asax so the physical files mostly don't exist. Everything was working fine until I had to remove site from IIS (8.5) and add it again.

And now I get 404 not found for every request. Example http://localhost/site/article123 And Global.asax Application_BeginRequest event not even firing.

If I however will add empty default.aspx file in folder /site/article123 everything starts to work fine with URL being correctly rewritten.

Files have not changed, so it's ought to be the problem with IIS configuration.

I do have following inside web.config:
<modules runAllManagedModulesForAllRequests="true">

Project in IIS is set as an Application with Application Pool .NET v2.0 Classic

Edit:
Same story in IIS 8.0

Sergej Popov
  • 2,933
  • 6
  • 36
  • 53

2 Answers2

8

The problem was in Managed Pipeline Mode set as classic. Switching from classic to integrated by changing Application pool from .NET v2.0 Classic to .NET v2.0 sorted the problem.

As I understood this: in classic mode IIS is managing requests, while in intergated mode incoming IIS requests map to the ASP.NET engine.

More on pipeline modes: What is the difference between 'classic' and 'integrated' pipeline mode in IIS7?

Community
  • 1
  • 1
Sergej Popov
  • 2,933
  • 6
  • 36
  • 53
  • I have always been in Integrated. 30 pools working and only 1 single pool is not. Then I just changed to classic and back to integrated, now it's working. – TPG Nov 14 '17 at 06:53
0

You need to have ReWrite Module installed under IIS 8.5

Use Web Installer Platform to install it.

GKG4
  • 440
  • 1
  • 4
  • 16
  • I don't think I need ReWrite module installed. As I have said I use `HttpContext.Current.RewritePath(...)` for URL rewriting, and AFAIK it doesn't have dependency on rewrite module. In any case, I do have the ReWrite module installed so it's not the issue. – Sergej Popov Mar 05 '14 at 13:16
  • There is no such thing as .net v4.5 Pool. Has anyone got this to work? I have dotnet 4.0 pool and Integrated and still Application_BeginRequest never fires on IIS8. – MC9000 Apr 20 '16 at 10:19