我有一個設置IIS URLRewrite條件的問題,以便在輸入的url無效時將它帶到設置的url。例如,你輸入url:example.local/current_work這將是一個有效的網址,所以它顯示的網頁,但是爲url:example.local/this_doesnt_exist它會重新引導你回到example.local/current_work等...如何在IIS中設置條件UrlRewrite以檢查URL是否有效
希望我明白這一點。
<rewrite>
<rules>
<rule name="Test" stopProcessing="true">
<match url="^scottishtrunkroadsse.amey.local/([_0-9a-z-]+)" negate="false"/>
<conditions>
<add input="{REQUEST_FILENAME}" matchType="IsDirectory" negate="true" />
<add input="{REQUEST_FILENAME}" matchType="IsFile" negate="true" />
</conditions>
<action type="Redirect" url="current-works/" />
</rule>
</rules>
<rewrite>
謝謝你的幫助。
我正在使用Umbraco網站,但我不認爲改變任何東西,因爲IIS網址應該以相同的方式工作。
預先感謝您。
你想創建重定向'example.local/this_doesnt_exist'爲'example.local/current_work'。只爲這個網址?或者你有沒有不存在的網址列表? –
只爲這個網址,謝謝 –