1
我使用的是Windows 7(IIS 7.5),並一直在努力使其設置爲使用無擴展url。這是我的web.config是什麼樣子:如何在castlerock單軌上爲無擴展url配置IIS 7.5
<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>
去任何URL一個沒有擴展名給出了一個404 - 通過ASP.NET拋出資源無法找到錯誤。任何幫助將不勝感激。
感謝您的回覆。如果我去「http:// localhost/mysite」,那麼我會得到「Url小於2令牌」。如果我添加一個斜槓或去「http:// localhost/mysite/home」那麼我得到「Controller not found。Area:''Controller Name:''」如果我去「http:// localhost/mysite/home/index「,那麼頁面顯示出來,但是找不到所有的靜態文件(css,images等)。 – Justin 2010-07-29 18:08:24
對於靜態內容,下面是一個示例css文件:http:// localhost:88/content/css/blueprint/plugins/buttons/screen.css - 這裏是錯誤:「Controller not found。Area:'content/css/blueprint/plugins'控制器名稱:'按鈕' – Justin 2010-07-29 18:13:04
至於靜態內容 - 錯誤表明ASP.NET正在處理MR處理程序。 您需要確保MR處理程序最後列在標記上,因爲它是通配符映射,並且會在其後面抑制任何東西。 也嘗試設置一個處理程序的CSS明確: ' ' –
2010-07-30 21:03:43