1
我有以下規則:IIS 7.5 URL重寫2.0到HTML頁
<rewrite>
<rules>
<rule name="FlowURLs">
<match url="^flows/[_0-9a-zA-Z-]+/[_0-9a-zA-Z-]+/([._0-9a-zA-Z-]+)" />
<action type="Rewrite" url="music.html?flow={R:1}" />
<conditions logicalGrouping="MatchAny">
<add input="{URL}" pattern="^.*\.(ashx|axd|css|gif|png|jpg|jpeg|js|flv|f4v|html)$" negate="true" />
</conditions>
</rule>
</rules>
</rewrite>
我所試圖做的是如果URL進入類似如下:
http://localhost/flows/t/twit_nobone/twit_nobone1354334226132.mp3
我想將其改寫爲:
http://localhost/music.html?id=twit_nobone1354334226132.mp3
music.html駐留在根中,它具有樣式表,javascript和圖像。我看到的問題是,當它重寫時,沒有圖像,js或樣式表正在顯示。當我檢查的資源,它看起來像鏈接現在是
http://localhost/flows/t/twit_nobone/twit_nobone1354334226132.mp3/demo.css
http://localhost/flows/t/twit_nobone/twit_nobone1354334226132.mp3/images/screenshot.png
代替
http://localhost/demo.css
http://localhost/images/screenshot.png
我在做什麼錯?我還注意到,瀏覽器中的url永遠不會改變爲重寫的。
你是一個生命的救星。一直在這工作幾個小時! – nawlrus 2013-03-21 18:11:44