Reputation: 640
I've implemented "Approach 3: Using an HttpModule to Perform Extension-Less URL Rewriting with IIS7" from here: - http://weblogs.asp.net/scottgu/archive/2007/02/26/tip-trick-url-rewriting-with-asp-net.aspx
That is based on URLRewriter module: - http://urlrewriter.net/
It seems to work on my local environment but on production server (running IIS 7) it shows "404 - File or directory not found" page.
I've searched on Google and could not seem to find the solution.
In the end, we went back to IIS 6 and followed the instructions here which worked: - http://urlrewriter.net/index.php/support/installation/windows-server-2003
But someday we may have to upgrade to IIS 7 on a shared hosting environment and the same issue will appear again!
Upvotes: 3
Views: 8534
Reputation: 1440
For IIS 7
Copy the HttpModules definition in your web.config file from system.web to system.webServer
<system.webServer>
<modules>
<add name="UrlRewriter" type="Intelligencia.UrlRewriter.RewriterHttpModule, Intelligencia.UrlRewriter"/>
</modules>
<system.webServer>
Application Pools: Managed Pipiline Mode = Integrated
Upvotes: 0
Reputation: 675
I had a similar issue that my page p1 (has been rewritten, originally is p1.aspx) was mistakenly regarded as p1 directory.
I added <modules runAllManagedModulesForAllRequests="true" /> to the <system.webServer> in the web.config and it seems begin to work.
Upvotes: 0
Reputation: 640
The hosting dude got it to work in IIS 7. The HTTP handlers requires wildcard mapping with different application pool to make it work in IIS 7. Hope this helps.
Make sure you have the following in Web.Config:
<system.webServer>
<validation validateIntegratedModeConfiguration="false"/>
<handlers>
<add name="wildcard" path="*" verb="*" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="None" preCondition="classicMode,runtimeVersionv2.0,bitness32" />
</handlers>
</system.webServer>
Upvotes: 5
Reputation: 6085
My colleague had the same problem and I check that he sets the app pool to use the Classic Pipeline instead of using the Integrated Pipeline which he should use and changing this to Integrated solved the problem. Maybe this could solve yours as well?
Upvotes: 0