asp.netiisurlrewriter

Intelligencia.UrlRewriter does not work in IIS8 or IIS Express 8?


i have installed new visual studio 2013 with Update 3 on server 2012 R2 OS (this is my test OS for programming and SQL )

but recently when i compile project using IIS Express , i face with 404 error for my mapped urls which are using Intelligencia.UrlRewriter last version. ERROR PAGE CONTAINS :

Requested URL     http://localhost:2706/technology/Astronomy/2014/9/28/1853.html  
Physical Path      E:\project\technology\Astronomy\2014\9\28\1853.html
Logon Method       Anonymous
Logon User     Anonymous
Request Tracing Directory      C:\Users\Administrator\Documents\IISExpress\TraceLogFiles\Project

more specifications about my projects are:

.net framework:4 Managed pipline mote :classic ( when i change it to Integrated ,nothing happened !)

my web.config file is as following:

<configSections>
    <section name="rewriter" requirePermission="false" type="Intelligencia.UrlRewriter.Configuration.RewriterConfigurationSectionHandler, Intelligencia.UrlRewriter" />  
  </configSections>

. . .

 <httpModules>
      <add name="UrlRewriter" type="Intelligencia.UrlRewriter.RewriterHttpModule, Intelligencia.UrlRewriter"/>
    </httpModules>

. . .

 <system.webServer>
    <modules>
      <remove name="UrlRewriter"/>
      <add name="UrlRewriter" type="Intelligencia.UrlRewriter.RewriterHttpModule,Intelligencia.UrlRewriter" preCondition="managedHandler"/>
      <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" preCondition="managedHandler"/>
    </modules>

. . .

    <!--Sample-->
 <rewriter>
    <rewrite url="~/up/(.+)/(.+)/(.+)/default.html" to="~/client/default.aspx?u=$1&amp;n=$2&amp;pi=0&amp;ps=5"/>

Solution

  • i changed this setting and now it works :

    in the properties of project i changed
    Managed pipline mote :classic -> to Intergrated

    and
    in web.config file :

     <system.webServer>
            <validation validateIntegratedModeConfiguration="false" />
            <modules runAllManagedModulesForAllRequests="true" >
              <add name="UrlRewriter" type="Intelligencia.UrlRewriter.RewriterHttpModule,Intelligencia.UrlRewriter" preCondition="managedHandler"/>
              <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" preCondition="managedHandler"/>
            </modules>