Hi dgdev,
Thanks for the note.
I did what you suggested, and it's still not working.
Here's my web.config:
<system.webServer>
<modules runAllManagedModulesForAllRequests="true">
<remove name="ScriptModule"/>
<add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add name="UrlRewriter" type="Intelligencia.UrlRewriter.RewriterHttpModule" />
</modules>
<validation validateIntegratedModeConfiguration="false"/>
<handlers>
<remove name="ScriptHandlerFactory"/>
<remove name="ScriptHandlerFactoryAppServices"/>
<remove name="ScriptResource"/>
<remove name="WebServiceHandlerFactory-Integrated"/>
<add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add name="ScriptResource" preCondition="integratedMode" verb="GET,HEAD" path="ScriptResource.axd" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add name="ASP.NET-ISAPI-2.0-Wildcard"
path="*" verb="GET,HEAD,POST,DEBUG"
modules="IsapiModule"
scriptProcessor="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll"
preCondition="classicMode,runtimeVersionv2.0,bitness32" responseBufferLimit="0" />
</handlers>
</system.webServer>
<rewriter>
<rewrite url="^~/Test1/(.*)$" to="~/TestUrlRewrite.aspx?PageContentUrl=Test1/$1" processing="stop"></rewrite>
<rewrite url="^~/Test1/$" to="~/TestUrlRewrite.aspx?PageContentUrl=Test1" processing="stop"></rewrite>
<rewrite url="^~/AboutUs$" to="~/Pages/Default.aspx?PageContentUrl=AboutUs" processing="stop"></rewrite>
</rewriter>
The above rules all work when I'm working on VS2008. (e.g. http://localhost:2649/App).
The rewrites are all ok and successful.
However, when I use this through IIS7.0, using http://localhost/App... the problems are below.
Problem.
The rewrite:
http://localhost/App/test1/ --> Requested URL: /App/test1/lRewrite.aspx
http://localhost/App/test1/1 --> Requested URL: /App/test1/1/Rewrite.aspx
http://localhost/App/test1/12 --> Requested URL: /App/test1/12/ewrite.aspx
http://localhost/App/test1/12345 --> Requested URL: /App/test1/12345/ite.aspx
There is a pattern here:
My target URL filename is : "TestUrlRewrite.aspx" (<- let this be called "TargetFileName").
The server is rewriting the URL minus the length of the "source" URL, starting from "test1".
For example,
http://localhost/App/test1/12345 --> Requested URL: /App/test1/12345/ite.aspx
Length of "test1/12345" is 11.
The targetURL will be rewritten right(TargetFileName, len(TargetFileName) - 11) = "ite.aspx" where the first 11 characters ("TestUrlRewr") have been removed/truncated.
HOWEVER
If however, I exceed the length of TargetFileName, the URLRewriting works!
http://localhost/App/test1/12345123123123123 --> The server brings me to the target page. :)
Hope I'm making sense, and you're following my details.
Hope you can help. :)