ASP.NET Context RewritePath 404 Error

I have a .net 4.0 web application running like a charm on my local computer and an old web server. Both computers use the classic .net 4.0 application pool without any problems.

But when I switched to the new web server, it gave a 404 error instead of rewriting the urls. I created the new application as simple as possible. It rewrites all the request paths to default.aspx, as shown below:

Global.asax.cs

protected void Application_BeginRequest(object sender, EventArgs e)
{
    Context.RewritePath("default.aspx", false);
}

I can access default.aspx if I make a direct request to the file, but when I make a request to the address except for 'default.aspx', I get a 404 error from the static file handler.

Do you have an idea how I can fix this?

Full size image here enter image description here

+3
2

. , AppPool Identity -. ApplicationPoolIdentity Managed Pipeline Mode .

- system.webserver - .

<system.webServer><modules runAllManagedModulesForAllRequests="true"> </modules></system.webServer>
+3

. URL- APP_Code, Visual Studio 2008 IIS 6.5, IIS 7.5. "OnBeginRequest", , , 404. , :

IIS 7.5 - " .NET AppPool".

Web.config URL:

<httpModules>
     <add name="*URLRewriteClassName*" type="*Namespace.URLRewriteClassName*"/>
  </httpModules>      

, , . , !

+1

All Articles