4
votes

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

1

1 Answers

0
votes

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>