質問

I'm using Windows 7 (IIS 7.5) and have been struggling with getting it setup to use extensionless url's. This is what my web.config looks like:

<system.webServer>
        <validation validateIntegratedModeConfiguration="false" />
        <handlers>
        <clear />
        <add name="ASPX" path="*.aspx" verb="*" type="" modules="IsapiModule" scriptProcessor="C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="Script" allowPathInfo="false" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="4194304" />
        <add name="StaticF" path="*.*" verb="FILE, GET" type="" modules="StaticFileModule" scriptProcessor="" resourceType="Unspecified" requireAccess="Script" allowPathInfo="false" preCondition="" responseBufferLimit="4194304" />
        <add name="MR" path="*" verb="*" type="" modules="IsapiModule" scriptProcessor="C:\Windows\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" resourceType="Unspecified" requireAccess="Script" allowPathInfo="false" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="4194304" />
    </handlers>
    </system.webServer>

Going to any url without an extension gives a 404 - resource cannot be found error thrown by ASP.NET. Any help would be greatly appreciated.

役に立ちましたか?

解決

Assuming you do not want regular webforms you could remove the "ASPX" line

As for the mapping of "*" to MR, you need another handler factory to set in the "type" attribute:

<add name="MR" path="*" verb="*" 
     type="Castle.MonoRail.Framework.MonoRailHttpHandlerFactory, 
           Castle.MonoRail.Framework" 
     modules="ManagedPipelineHandler" 
     scriptProcessor="" 
     resourceType="Unspecified" 
     requireAccess="Script" 
     allowPathInfo="false" 
     preCondition="" 
     responseBufferLimit="4194304" /> 
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top