httpModules not work with iis 7.5 for url rewriting/extention less url (give error 500.0)

4

I am using URL rewriting with IHttpModule. Application work on local but on server application give error if I written path without extension (aspx).

I had register URL rewriting module in web config like

   <system.webServer>
    <validation validateIntegratedModeConfiguration="false" />
         <modules>
      <add name="URLRewriteModule" type="URLRewriteModule" preCondition="ManagedHandler" />
    </modules>
    <defaultDocument>
      <files>
        <add value="Login.aspx" />
      </files>
    </defaultDocument>
  </system.webServer>

And also ExtensionlessUrlHandler-Integrated-4.0, ExtensionlessUrlHandler-ISAPI-4.0_64bit, ExtensionlessUrlHandler-ISAPI-4.0_32bit handler are there. Then also I am getting following error

HTTP Error 500.0 - Internal Server Error

Module ManagedPipelineHandler

Notification ExecuteRequestHandler

Handler ExtensionlessUrlHandler-Integrated-4.0

Error Code 0x800703e9

asp.net
url-rewriting
iis-7.5
ihttphandler
httpmodule
asked on Stack Overflow Nov 4, 2011 by JD Varu

1 Answer

0

I think you have miss a config.

The following is an example, custom http module should be configed both in system.web node and system.webserver node

  <system.web>
<compilation debug="true" targetFramework="4.0" />
<httpModules>
  <add name="CustomHttpModule" type="Routing_Static_Page_Demo.WebModule.CustomHttpModule, Routing_Static_Page_Demo" />
</httpModules>

<system.webServer>
<modules runAllManagedModulesForAllRequests="true">
  <remove name="UrlRoutingModule"/>
  <add name="UrlRoutingModule" type="System.Web.Routing.UrlRoutingModule, 
                                    System.Web, 
                                    Version=4.0.0.0, 
                                    Culture=neutral, 
                                    PublicKeyToken=b03f5f7f11d50a3a" />
  <add name="CustomHttpModule" type="Routing_Static_Page_Demo.WebModule.CustomHttpModule" />
</modules>

answered on Stack Overflow Aug 8, 2012 by keep fool

User contributions licensed under CC BY-SA 3.0