문제

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