2016-09-23 77 views
0

http://www.iis.net/learn/extensions/url-rewrite-module/url-rewrite-module-configuration-referenceURL重寫規則不用於文件

<rule name="AngularJS Routes" stopProcessing="true"> 
     <match url=".*" /> 
     <conditions logicalGrouping="MatchAll"> 
     <add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" /> 

     </conditions> 
     <action type="Rewrite" url="/index.html" /> 
    </rule> 

以上是幾個URL重寫規則角度單個頁面的應用廣泛地提出了一個忽略請求。 我明白規則的意思是「如果請求不是針對物理文件,請將URL重寫爲/index.html。

摘自上述文檔鏈接:」這可以用於指定一個條件,檢查請求的URL不是一個文件...」

index.html中我有此腳本參考:

<script src="lib/jquery/dist/jquery.min.js"></script> 

這是一個物理文件,它並在指定的位置在磁盤上存在
重寫規則正在提取此請求並將其重寫到/index.html。
這是爲什麼發生? 我的web.config位於wwwroot的同一級別。

有GitHub上幾個線程相關的URL重寫,不知道這個具體問題上覆蓋: https://github.com/aspnet/BasicMiddleware/issues/43 https://github.com/aspnet/IISIntegration/issues/164 https://github.com/aspnet/IISIntegration/issues/192

回答